LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Filter syslog (https://www.linuxquestions.org/questions/debian-26/filter-syslog-856477/)

razzera 01-15-2011 08:44 AM

Filter syslog
 
Hello

I wonder how i can filter the syslog ? ie there is a message that i dont want to se logged in there etc?

acid_kewpie 01-15-2011 09:48 AM

This depends on the syslog service you're using. I personally prefer syslog-ng which has various ways to do this which you can read about in it's standard documentation. More standard older syslog daemons don't really permit this, although rsyslog is very similar in terms of config to the normal syslog.conf but does provide more options.

razzera 01-17-2011 04:14 PM

Quote:

Originally Posted by acid_kewpie (Post 4225207)
This depends on the syslog service you're using. I personally prefer syslog-ng which has various ways to do this which you can read about in it's standard documentation. More standard older syslog daemons don't really permit this, although rsyslog is very similar in terms of config to the normal syslog.conf but does provide more options.

i was loooking trough it and i dont quite understand. Can you give me an example in syslog-ng of how i filter(so it wont get logged) anyting that has a certain word/phrase in it ?

unSpawn 01-17-2011 04:43 PM

Here's an example for rsyslog:
Code:

:msg, contains, "Will not restore" ~
which blocks out certain 'restorecond' messages. As you can see it's just a basic string match.


All times are GMT -5. The time now is 09:37 AM.