[syslog-ng]host x.x.x.111 is the same as x.x.x.11 (filter error?)

Balazs Scheidler bazsi@balabit.hu
Tue, 2 Jul 2002 17:13:45 +0200


On Tue, Jul 02, 2002 at 07:18:34AM -0700, Lubos Vitek wrote:
> Hallo, 
> 
> I have found a bug (or a feature?) in the syslog-ng
> daemon. I used a filter:
> 
> filter f_host11  { host("192.168.1.11"); };
> filter f_host111 { host("192.168.1.111"); };
> 
> destination d_host11 {file("/var/log/other/11.log");};
> destination d_host111
> {file("/var/log/other/111.log");};
> 
> log{source(s_other);filter(f_host11);destination(d_host11);};
> log{source(s_other);filter(f_host111);destination(d_host111);};
> 
> Then, when I try to log something on 192.168.1.111, I
> receive a log record in both files: 111.log and 11.log
> too ! What am I doing wrong ?

it is a feature :) host applies a regular expression, which matches
substrings. If you want to match the whole string try the following:

filter f_host { host("^host$"); };

-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1