Rsyslogd and characters # 012 and # 015

I am using rsyslogd version 5.8. The characters \ n and \ r are reset as # 012 and # 015 to the log file.

Example (when entering the command: printf "example-test [\ r]" | logger):

<13> 2014-07-07T11:01:03.254 root: example-test[#015] 

I would like to reset them in hexadecimal format: # 0A and # 0D (or another more readable format).

How can I do this by modifying the rsyslogd configuration file?

+12
rsyslog
source share
1 answer

After reading the source code of versions 5.8.3 and 7.6.0 rsyslogd it turns out that:

  • the hexadecimal base cannot be used because the octal base (# 012, # 015) is hard-coded.
  • escaping can be turned on or off: the $ EscapeControlCharactersOnReceive and $ Escape8BitCharactersOnReceive parameters

The documentation confirms that:

https://www.rsyslog.com/doc/v7-stable/configuration/input_directives/rsconf1_escapecontrolcharactersonreceive.html

https://www.rsyslog.com/doc/v7-stable/configuration/input_directives/rsconf1_escape8bitcharsonreceive.html

+9
source share

All Articles