I use rsyslogd version 5.8. The characters \n and \r are dumped as #012 and #015 in the log file.
Example (by entering command: printf "example-test[\r]" | logger) :
<13> 2014-07-07T11:01:03.254 root: example-test[#015]
I would rather like to dump them in hexadecimal: #0A and #0D (or other more human-readable format).
How could I do this by modifying the rsyslogd configuration file?
rsyslog is capable of forwarding logs to remote servers. The configuration is relatively simple and makes it possible for Linux admins to centralize log files for archiving and troubleshooting.
The rsyslogd daemon reads a socket and sends the message line to a destination that is specified by the /etc/rsyslog.conf configuration file. The rsyslogd daemon reads the configuration file when it is activated.
They allow to filter on any property, like HOSTNAME, syslogtag and msg. A list of all currently-supported properties can be found in the rsyslog properties documentation. With this filter, each property can be checked against a specified value, using a specified compare operation.
conf file is the main configuration file for the rsyslogd(8) which logs system messages on *nix systems. This file specifies rules for logging. For special features see the rsyslogd(8) manpage. Rsyslog.
After reading the source code of rsyslogd versions 5.8.3 and 7.6.0, it appears that :
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With