expression-based filter troubles with 3.21.9

This is the place for you, if you got rsyslog up and running but wonder how to make it do what you want.

Moderator: rgerhards

expression-based filter troubles with 3.21.9

Postby ajschorr » Thu Feb 12, 2009 2:59 am

Hi,

I'm just upgrading to Fedora 10, and rsyslog is now the default syslog daemon.
The current version is 3.21.9-2.fc10. I'm trying to migrate a syslog-ng
configuration, and so far I like the approach in rsyslog.

However, one of my filter expressions was giving me strange results, so I broke
it down into the following snippet whose behavior I cannot understand:

$template CronFormat,"%timereported% %HOSTNAME% %syslogtag% [cronrule %syslogseverity-text% %syslogseverity%]%msg:::sp-if-no-1st-sp%%msg%\n"

if ($syslogfacility-text == 'cron') and ($syslogseverity <= 4) \
then -/var/log/messages;CronFormat

This is the only action that uses the CronFormat template. I cannot understand why I am
seeing entries like these in /var/log/messages:

Feb 11 20:50:01 ti82 CROND[12005]: [cronrule info 6] (root) CMD (/usr/lib/sa/sa1 -d 1 1)

The template for the message shows us quite clearly that the syslogseverity value
is 6, and the filter expression is supposed to limit us to messages where the severity
is <= 4. So why does this message appear? Is this a bug in the filter expression
evaluator? Should I try building a different version of rsyslog? Or am I just confused
and not understanding how this stuff is supposed to work?

Thanks in advance for any help you can provide,
Andy
ajschorr
New
 
Posts: 6
Joined: Wed Feb 11, 2009 10:34 pm

Professional Services Information

  • Custom written rsyslog.conf?
  • Maintenance Contract?
  • Installation support?

Re: expression-based filter troubles with 3.21.9 and 3.20.4

Postby ajschorr » Thu Feb 12, 2009 3:19 am

FYI, I just built 3.20.4, and I am seeing the same behavior.

Regards,
Andy
ajschorr
New
 
Posts: 6
Joined: Wed Feb 11, 2009 10:34 pm

Re: expression-based filter troubles with 3.21.9

Postby rgerhards » Thu Feb 12, 2009 8:00 am

Hi Andy,

could you provide a debug log while such a message is being processed? That would probably give more insight.

Details here: http://www.rsyslog.com/doc-debug.html

Rainer
User avatar
rgerhards
Site Admin
 
Posts: 2647
Joined: Thu Feb 13, 2003 11:57 am

Re: expression-based filter troubles with 3.21.9

Postby ajschorr » Thu Feb 12, 2009 3:06 pm

Hi Rainer,

Sure, no problem. I hope I did this the right way.

I ran this command: rsyslogd -c3 -dn > /tmp/rsyslog.log
And then I used the "logger" command to inject a test message to demonstrate the problem,
like so:
logger -p cron.info this is a fake cron message

I am attaching the log file, as well as rsyslog.conf.

I'm aware that it's probably not a good idea to have multiple actions that use the same file,
but I did this in order to debug the problem (originally there was one big expression for
/var/log/messages).

Actually, I am strangely unable to upload attachments. Each time I try (using firefox 3.0.6 running
on linux), I get an error says "The extension XXX is not allowed", where XXX is whatever
extension I happened to try (such as txt or log or dbg). I feel very stupid. I tried
a filename with no extension at all, but it will still not accept it. Can anybody offer guidance
on how to send an attachment? I must be doing something incredibly dumb...
Or is there somewhere I can email the 2 files?

Thanks for your help,
Andy

P.S. I really like the "discard" feature. That was a great idea.
ajschorr
New
 
Posts: 6
Joined: Wed Feb 11, 2009 10:34 pm

Re: expression-based filter troubles with 3.21.9

Postby rgerhards » Thu Feb 12, 2009 3:20 pm

Just mail me at rgerhards@gmail.com, but drop me a note you have done so here at the forum. I haven't checked, but I think almost all attachments are turned off to prevent spread of warez and malware...

Rainer
User avatar
rgerhards
Site Admin
 
Posts: 2647
Joined: Thu Feb 13, 2003 11:57 am

Re: expression-based filter troubles with 3.21.9

Postby ajschorr » Thu Feb 12, 2009 3:26 pm

Hi Rainer,

I just emailed you the files.

Thanks for your help,
Andy
ajschorr
New
 
Posts: 6
Joined: Wed Feb 11, 2009 10:34 pm

Re: expression-based filter troubles with 3.21.9

Postby rgerhards » Fri Feb 13, 2009 7:45 am

Andy,

I was dragged in a bit project (quite unexpected), will look at them ASAP, but it may be I can't manage before next week. Will try my best...

Rainer
User avatar
rgerhards
Site Admin
 
Posts: 2647
Joined: Thu Feb 13, 2003 11:57 am

Re: expression-based filter troubles with 3.21.9

Postby ajschorr » Fri Feb 13, 2009 4:34 pm

Hi Rainer,

That's no problem. I suppose I could always debug the code myself, but I'm not
feeling that energetic. For now, we are falling back to syslog-ng.

Regards,
Andy
ajschorr
New
 
Posts: 6
Joined: Wed Feb 11, 2009 10:34 pm

Re: expression-based filter troubles with 3.21.9

Postby ajschorr » Fri Mar 27, 2009 1:27 pm

FYI, I reported this problem to Redhat bugzilla here:

https://bugzilla.redhat.com/show_bug.cgi?id=485937

and they suggest a workaround of putting quotes around the numeric constant
being compared. I guess there's a problem with the implicit type conversions.

Regards,
Andy
ajschorr
New
 
Posts: 6
Joined: Wed Feb 11, 2009 10:34 pm

Re: expression-based filter troubles with 3.21.9

Postby rgerhards » Fri Mar 27, 2009 2:32 pm

I got a patch from red hat, that is now integrated (but not yet released), looks like it is exactly *that* issue - didn't make the connection, when I got the patch, sorry for that...

Rainer
User avatar
rgerhards
Site Admin
 
Posts: 2647
Joined: Thu Feb 13, 2003 11:57 am

Google Ads



Return to Configuration

Who is online

Users browsing this forum: No registered users and 0 guests

cron