On Wed, 2010-01-27 at 22:59 +0100, Philip M. Gollucci wrote:
> Rainer Gerhards wrote:
> >> -----Original Message-----
> >> From: [email protected] [mailto:rsyslog-
> >> [email protected]] On Behalf Of Philip M. Gollucci
> >> Sent: Wednesday, January 27, 2010 8:17 PM
> >> To: rsyslog-users
> >> Subject: [rsyslog] config file help
> >>
> >> rsyslog.conf:
> >>
> >> ...
> >> if $facility == '1' && $priority == '7' then ~
> >
> > I don't have the code at hand right now, but I guess the codes must
> be
> > numeric:
> >
> > if $facility == 1 && $priority == 7 then ~
> 
> Ha, you think I didn't try that too.  No dice either way.
> 
> Forget meaningful, it spits out nothing [with debugging and/or
> ktracing]
> Just merely goes along and 'works' too well.

I just tried it out. I got the following error message:

===
2010-01-28T18:33:41.635158+01:00 rgf12 rsyslogd-2051: syntax error in
expression [try http://www.rsyslog.com/e/2051 ]
2010-01-28T18:33:41.635413+01:00 rgf12 rsyslogd: the last error occured
in /home/rger/proj/rsyslog/rg.conf, line 10:"if $facility == 1 &&
$priority == 7 then ~"
2010-01-28T18:33:41.635477+01:00 rgf12 rsyslogd: warning: selector line
without actions will be discarded
2010-01-28T18:33:41.636170+01:00 rgf12 rsyslogd-2124: CONFIG ERROR:
could not interpret master config file
'/home/rger/proj/rsyslog/rg.conf'. [try http://www.rsyslog.com/e/2124 ]
===

Not too precise (as expected), but far from not existent ;)

The syntax error is &&, you need to use "and". Also, the property names
were incorrect. So the correct line would have been:

if $syslogfacility == 1 and $syslogseverity == 7 then ~

While I have verified that this line works, you are far better of
(performance-wise) with the traditional priority filter that you now
use.

Rainer

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Reply via email to