0

I am using rsyslog to relay events from a machine to Loggly (cloud log management). I have an application running on that machine that logs to the local rsyslog by using the SyslogAppender of log4net. However, since some of the events are multi-line, thus contain new lines which are then replaced by the escape sequence #012. However, I would like to replace the newlines in the message part to <br/>. I have looked at rsyslogs property replacing [1] feature but I am not really sure if this is the right way. Furthermore, changing the implementation of the application would require some effort so I would like to avoid this way. So I am looking for a way to solve this issue "outside" of my application.

Thanks in advance for any help or suggestions!

[1] http://www.rsyslog.com/doc/property_replacer.html

Simon S.
  • 563
  • 4
  • 21

1 Answers1

0

It seems that the #12s is getting produced by log4net - not by syslog. If you don't want to change the application, you can use sed to replace the #12 by <br/>:

sed 's/#12/\n/g' logfile
hek2mgl
  • 152,036
  • 28
  • 249
  • 266