# syslog-ng su: ( to nagios )

**URL:** <https://forums.suse.com/t/syslog-ng-su-to-nagios/23304>\
**Category:** SLES Configure-Administer\
**Created:** [November 13, 2012, 9:49am UTC](https://forums.suse.com/t/syslog-ng-su-to-nagios/23304 "2012-11-13T09:49:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbrinkmann](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tbrinkmann](https://forums.suse.com/u/tbrinkmann)\
**Post date:** [November 13, 2012, 9:49am UTC](https://forums.suse.com/t/syslog-ng-su-to-nagios/23304/1 "2012-11-13T09:49:44Z")

</div>

Hi,  
I try use syslog-ng to cut out some annoying messages from our message file. The check\_mk nagios client is polling every 5 minutes. So the user root su to nagios and  
this is reported in /var/log/messages. I create a filter to move the messages to /var/log/su/nagios

# SU NAGIOS Filters

filter f\_su { match(‘to nagios’); };

# SU Logging

destination sude { file(“/var/log/su/nagios”); };

log { source(src); filter(f\_su); destination(sude); flags(final); };

My problem now is that the messages are reported in both files.  
Does anyone can tell me what I have to change that these massages only will stored in the /var/log/su/nagios file.

Aditional question: Why SLES is using syslog-ng in version 1.x does it make sense to upgrate to syslog-ng V3 ?

\*T

---

<div class="post-metadata">

**Author:** ![tbrinkmann](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tbrinkmann](https://forums.suse.com/u/tbrinkmann)\
**Post date:** [November 13, 2012, 12:02pm UTC](https://forums.suse.com/t/syslog-ng-su-to-nagios/23304/2 "2012-11-13T12:02:02Z")

</div>

The final filter must be used before the message filter …

---

<div class="post-metadata">

**Author:** ![smflood](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/smflood/32/10576_2.png) [@smflood](https://forums.suse.com/u/smflood)\
**Post date:** [November 13, 2012, 7:25pm UTC](https://forums.suse.com/t/syslog-ng-su-to-nagios/23304/3 "2012-11-13T19:25:49Z")

</div>

On 13/11/2012 07:54, tbrinkmann wrote:  
[color=blue]

> I try use syslog-ng to cut out some annoying messages from our message  
> file. The check\_mk nagios client is polling every 5 minutes. So the user  
> root su to nagios and  
> this is reported in /var/log/messages. I create a filter to move the  
> messages to /var/log/su/nagios
> 
> # SU NAGIOS Filters
> 
> filter f\_su { match(‘to nagios’); };
> 
> # SU Logging
> 
> destination sude { file(“/var/log/su/nagios”); };
> 
> log { source(src); filter(f\_su); destination(sude); flags(final); };
> 
> My problem now is that the messages are reported in both files.  
> Does anyone can tell me what I have to change that these massages only  
> will stored in the /var/log/su/nagios file.[/color]

You need to edit the f\_messages filter to add ‘and not filter(f\_su)’  
before the first semi-colon at the end of the filter line (so before ‘;  
};’).

## HTH.

Simon  
Novell/SUSE/NetIQ Knowledge Partner

* * *

## Do you work with Novell technologies at a university, college or school? If so, your campus could benefit from joining the Novell Technology Transfer Partner (TTP) program. See [novell.com/ttp](http://novell.com/ttp) for more details.
