[rsyslog-notify] Forum Thread: linefeed character in message - (Mode 'post')

noreply at adiscon.com noreply at adiscon.com
Thu Mar 20 13:41:22 CET 2014


User: dhaivat.desai 
Forumlink: http://kb.monitorware.com/viewtopic.php?p=24412#p24412

Message: 
----------
Hello,
I am sending a message with multiple linefeed characters. e.g.
[b:24mtez0r]This is my message.\nI am continuing this messagein second
line.\n\0[/b:24mtez0r]

This should be printed in log-file as follow:
[b:24mtez0r]This is my message.
I am continuing this messagein second line.[/b:24mtez0r]

However, it looks like that rsyslog considers
[b:24mtez0r]\n(linefeed)[/b:24mtez0r] as end of the message and everything
after [b:24mtez0r]\n[/b:24mtez0r] is considered as a new message and the
rest of the message content is parsed as a message header.
everything goes wrong from this point.

========

I use following configuration in rsyslog to log the messages:

template(name="dyn_file" type="string"
string="/var/log/my_rsyslog/%app-name%.log")

template(name="log_template" type="list") {
        property(name="timereported" DateFormat="rfc3339")
        constant(value=" ")
        property(name="syslogseverity-text" CaseConversion="upper"
position.from="1" position.to="3")
        constant(value=": ")
        property(name="msg")
        constant(value="\n")
}

# imtcp
module(load="imtcp" MaxSessions="500")
input(type="imtcp" port="7220")

*.* action(type="omfile"
DirCreateMode="0755"
FileCreateMode="0666"
Template="log_template"
DynaFile="dyn_file")

========

please suggest.

Best Regards,
Dhaivat Desai.


More information about the rsyslog-notify mailing list