Bug 951727

Summary: Untill ver 6.2.0 of rsyslog, the %pri-text% property includes the numeric string
Product: Red Hat Enterprise Linux 6 Reporter: Steve <sphariss>
Component: rsyslogAssignee: Tomas Heinrich <theinric>
Status: CLOSED ERRATA QA Contact: Dalibor Pospíšil <dapospis>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: dapospis, lnovich, pvrabec, sphariss
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
local0.info<164> Cause: Numerical value of the PRI property was appended to the "pri-text" variable. Consequence: The resulting value look like this: "local0.info<164>". Fix: The "<N>" suffix was removed. Result: Now, the variable only contains textual facility and severity values.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-21 23:40:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Steve 2013-04-12 21:48:59 UTC
Description of problem:
The released ver of rsyslog (5.8.10-6.el6.x86_64) has a bug where the %pri-text% template property returns the numeric code as part of the string.  This was fixed in ver 6.2.0 (http://www.rsyslog.com/doc/v6compatibility.html) 

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


How reproducible:


Steps to Reproduce:
1. in rsyslog.conf create a template with %pri-text%
$template pri-test,"%pri%: %pri-test%\n"
2. use template
*.info  /var/log/pritest;pri-test
3.look at log file and notice the second field
164: local0.info<164>
  
Actual results:

The pri numeric code is appended to the end of the %pri-text% property field
Expected results:
No numeric code

Additional info:

The rsyslog team posted the following concerning this "bug": http://www.rsyslog.com/doc/v6compatibility.html

Property "pri-text"

Traditionally, this property did not only return the textual form of the pri ("local0.err"), but also appended the numerical value to it ("local0.err<133>"). This sounds odd and was left unnoticed for some years. In October 2011, this odd behaviour was brought up on the rsyslog mailing list by Gregory K. Ruiz-Ade. Code review showed that the behaviour was intentional, but no trace of what the intention was when it was introduced could be found. The documentation was also unclear, it said no numerical value was present, but the samples had it. We agreed that the additional numerical value is of disadvantage. We also guessed that this property is very rarely being used, otherwise the problem should have been raised much earlier. However, we didn't want to change behaviour in older builds. So v6 was set to clean up the situation. In v6, text-pri will always return the textual part only ("local0.err") and the numerical value will not be contained any longer inside the string. If you actually need that value, it can fairly easily be added via the template system.

Comment 9 errata-xmlrpc 2013-11-21 23:40:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1716.html