Bug 485937 - expression-based filters do not seem to work properly
expression-based filters do not seem to work properly
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: rsyslog (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Tomas Heinrich
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-17 10:52 EST by Andrew J. Schorr
Modified: 2016-09-20 00:49 EDT (History)
2 users (show)

See Also:
Fixed In Version: 3.21.10-2.fc10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-21 20:52:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andrew J. Schorr 2009-02-17 10:52:58 EST
Description of problem:
I am trying to port a syslog-ng configuration to rsyslog.
I believe, however, that there are bugs in the filter expression evaluator
in rsyslog that makes it impossible to port the configuration successfully.
I opened a discussion thread on this in rsyslog forum here:
http://kb.monitorware.com/expression-based-filter-troubles-with-3-21-9-t8924.html


Version-Release number of selected component (if applicable):
3.21.9

How reproducible:
Install rsyslog.conf including a section like this:

$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/bug;CronFormat

Run rsyslog and note that you get entries like this:

bash-3.2$ cat /var/log/bug
Feb 17 10:50:01 ti82 CROND[31805]: [cronrule info 6] (root) CMD (/usr/lib/sa/sa1 -d 1 1)

This entry should not be there, since the severity (6) is not <= 4.


Steps to Reproduce:
1. Install /etc/rsyslog.conf with a filter expression similar to above
2. Run rsyslog
3. Observe that it does not filter properly.
  
Actual results:
Incorrect entries in /var/log/bug

Expected results:
The /var/log/bug file should be empty in the normal case (for info messages
about jobs that cron is running).

Additional info:
Comment 1 Tomas Heinrich 2009-03-13 18:47:40 EDT
There's a bug in the expression processing that breaks variables' conversion.
A current workaround is to use something like
  ($syslogseverity <= '4')
instead of
  ($syslogseverity <= 4)

This should soon be fixed in an updated package.
Thanks for the report.
Comment 2 Fedora Update System 2009-03-31 09:33:58 EDT
rsyslog-3.21.10-2.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/rsyslog-3.21.10-2.fc10
Comment 3 Fedora Update System 2009-04-02 13:12:37 EDT
rsyslog-3.21.10-2.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update rsyslog'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-3190
Comment 4 Fedora Update System 2009-04-21 20:52:26 EDT
rsyslog-3.21.10-2.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.