Gentoo Archives: gentoo-user

From: Fred Leon <raptor@××××××××.fr>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] syslog-ng filtering
Date: Wed, 17 Mar 2010 10:01:27
Message-Id: 20100317114809.15276ejrcffkv3hl@mail.drakonix.fr
In Reply to: Re: [gentoo-user] syslog-ng filtering by Ralph Slooten
1 Ralph Slooten <axllent@×××××.com> a écrit :
2
3 > On 17 March 2010 13:00, Roy Wright <roy@××××××.org> wrote:
4 >>
5 >> I just started with the example at:
6 >> http://en.gentoo-wiki.com/wiki/Syslog-ng
7 >>
8 >> HTH,
9 >> Roy
10 >
11 > Thanks Roy, however they have the same syntax which isn't working on my
12 > side.
13 >
14 > filter f_shorewall { not match("regex" value("Shorewall")); }
15 >
16 >
17 > I just tried a single rule (to make sure it wasn't my syntax):
18 >
19 > filter killVmMessages {
20 > not match("regex" value("vmware-checker"));
21 > };
22 >
23 > yet the "(root) CMD (/root/bin/vmware-checker)" messages still go through?!
24 >
25 > log {
26 > source(src);
27 > source(remote);
28 > filter(myfilter);
29 > filter(killVmMessages);
30 > destination(d_mysql);
31 > };
32 >
33 > I'm really stumped here. All other filters (non regex) works fine though,
34 > such as facility() & host().
35 >
36 > Are you able to filter by content?
37 >
38 > Ralph
39 >
40
41 Perhaps you could try this which is working for me and let me filter
42 all messages coming from iptables:
43
44 # firewall logging
45 destination iptables { file("/var/log/firewall/iptables.log"); };
46 filter f_iptables { message("iptables"); };
47 log { source(s_all); filter(f_iptables); destination(iptables); };
48
49 # all messages coming from kern
50 destination df_kern { file("/var/log/system/kern.log" ); };
51 filter f_kern { facility(kern) and not filter(f_iptables); };
52 log { source(s_all); filter(f_kern);destination(df_kern); };
53
54 Fred