Red Hat Bugzilla – Bug 951727
Untill ver 6.2.0 of rsyslog, the %pri-text% property includes the numeric string
Last modified: 2013-11-21 18:40:35 EST
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.
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