Trailing LF is dropped from host logger to rsyslog
Hi all,
We are using hostlogger in stream mode and forwarding the serial port data to rsyslog. rsyslog template is as below:
$EscapeControlCharactersOnReceive off
template(name="hostlog" type="string"
string="%rawmsg%"
)
However it seems the trailing LF "\n" of each socket transfer will be dropped when saving the messages to file, causing multiple lines joined together and hard to read.
Is there anything wrong in our configuration?
Thanks,
Heyi
Hi Heyi,
Phosphor-hostlooger in stream mode forwards the byte stream into rsyslog via the imuxsock module. The log is persisted via the omfile module as soon as collected. So we need to use imuxsock module to transfer the data. The below sample is my rsyslog settings:
module(load="imuxsock" SysSock.Use="off")
template(name="ConsoleTemplate" type="string" string="%rawmsg%")
ruleset(name="ConsoleRuleset") {
action(type="omfile" file="/var/log/console/log" template="ConsoleTemplate")
}
# Custom socket for serial console logs.
input(type="imuxsock"
Socket="/run/rsyslog/console_input"
CreatePath="on"
UseSpecialParser="off"
ParseHostname="off"
ruleset="ConsoleRuleset")
$EscapeControlCharactersOnReceive off
And we also need to set the socket path to hostlogger config(STREAM_DST). In this sample, the path is /run/rsyslog/console_input Hope this information is helpful to you.
Sincerely,
Spencer Ku
Quoted 30 lines
-----Original Message-----
From: openbmc <[email protected]> On Behalf Of Heyi Guo
Sent: Friday, February 25, 2022 4:07 PM
To: openbmc <[email protected]>
Cc: Alexander Amelkin <[email protected]>; Artem Senichev <[email protected]>; Alexander Filippov <[email protected]>
Subject: [hostlogger] Trailing LF is dropped from host logger to rsyslogHi all,
We are using hostlogger in stream mode and forwarding the serial port data to rsyslog. rsyslog template is as below:
$EscapeControlCharactersOnReceive off
template(name="hostlog" type="string"
string="%rawmsg%"
)However it seems the trailing LF "\n" of each socket transfer will be dropped when saving the messages to file, causing multiple lines joined together and hard to read.
Is there anything wrong in our configuration?
Thanks,
Heyi
Hi Spencer,
Thanks for your info; I check my configuration file and it is almost the same with the one you post, except for below items:
- SysSock.Use="off"
- UseSpecialParser="off"
- ParseHostname="off"
However the trailing LF of each transfer is still dropped in the target file.
Any other ideas?
PS: We are using the version of rsyslog from openbmc 2.10.0-rc1.
Thanks,
Heyi
Quoted 58 lines · Spencer Ku (古世瑜)
Hi Heyi,
Phosphor-hostlooger in stream mode forwards the byte stream into rsyslog via the imuxsock module. The log is persisted via the omfile module as soon as collected. So we need to use imuxsock module to transfer the data. The below sample is my rsyslog settings:
module(load="imuxsock" SysSock.Use="off")
template(name="ConsoleTemplate" type="string" string="%rawmsg%")
ruleset(name="ConsoleRuleset"){
action(type="omfile" file="/var/log/console/log" template="ConsoleTemplate")
}# Custom socket for serial console logs.
input(type="imuxsock"
Socket="/run/rsyslog/console_input"
CreatePath="on"
UseSpecialParser="off"
ParseHostname="off"
ruleset="ConsoleRuleset")$EscapeControlCharactersOnReceive off
And we also need to set the socket path to hostlogger
config(STREAM_DST). In this sample, the path is/run/rsyslog/console_inputHope this information is helpful to you.Sincerely,
Spencer KuQuoted 30 lines
-----Original Message-----
From: openbmc <[email protected]> On Behalf Of Heyi Guo
Sent: Friday, February 25, 2022 4:07 PM
To: openbmc <[email protected]>
Cc: Alexander Amelkin <[email protected]>; Artem Senichev <[email protected]>; Alexander Filippov <[email protected]>
Subject: [hostlogger] Trailing LF is dropped from host logger to rsyslogHi all,
We are using hostlogger in stream mode and forwarding the serial port data to rsyslog. rsyslog template is as below:
$EscapeControlCharactersOnReceive off
template(name="hostlog" type="string"
string="%rawmsg%"
)However it seems the trailing LF "\n" of each socket transfer will be dropped when saving the messages to file, causing multiple lines joined together and hard to read.
Is there anything wrong in our configuration?
Thanks,
Heyi
Quoted 4 lines · Heyi Guo
Hi Spencer,
Thanks for your info; I check my configuration file and it is almost the same with the one you post, except for below items:
Quoted 8 lines
- SysSock.Use="off"
- UseSpecialParser="off"
- ParseHostname="off"
However the trailing LF of each transfer is still dropped in the target file.
I mean the issue is still there after adding the above 3 items to configuration file.
Heyi
Quoted 69 lines
Any other ideas?
PS: We are using the version of rsyslog from openbmc 2.10.0-rc1.
Thanks,
Heyi
Quoted 58 lines · Spencer Ku (古世瑜)
Hi Heyi,
Phosphor-hostlooger in stream mode forwards the byte stream into rsyslog via the imuxsock module. The log is persisted via the omfile module as soon as collected. So we need to use imuxsock module to transfer the data. The below sample is my rsyslog settings:
module(load="imuxsock" SysSock.Use="off")
template(name="ConsoleTemplate" type="string" string="%rawmsg%")
ruleset(name="ConsoleRuleset"){
action(type="omfile" file="/var/log/console/log" template="ConsoleTemplate")}# Custom socket for serial console logs.
input(type="imuxsock"
Socket="/run/rsyslog/console_input"
CreatePath="on"
UseSpecialParser="off"
ParseHostname="off"
ruleset="ConsoleRuleset")$EscapeControlCharactersOnReceive off
And we also need to set the socket path to hostlogger
config(STREAM_DST). In this sample, the path is/run/rsyslog/console_inputHope this information is helpful to you.Sincerely,
Spencer KuQuoted 30 lines
-----Original Message-----
From: openbmc <[email protected]> On Behalf Of Heyi Guo
Sent: Friday, February 25, 2022 4:07 PM
To: openbmc <[email protected]>
Cc: Alexander Amelkin <[email protected]>; Artem Senichev <[email protected]>; Alexander Filippov <[email protected]>
Subject: [hostlogger] Trailing LF is dropped from host logger to rsyslogHi all,
We are using hostlogger in stream mode and forwarding the serial port data to rsyslog. rsyslog template is as below:
$EscapeControlCharactersOnReceive off
template(name="hostlog" type="string"
string="%rawmsg%"
)However it seems the trailing LF "\n" of each socket transfer will be dropped when saving the messages to file, causing multiple lines joined together and hard to read.
Is there anything wrong in our configuration?
Thanks,
Heyi
Finally, I found this feature is controlled by the global option: DropTrailingLFOnReception. After setting it off, the tailing LF will not be dropped any more.
$DropTrailingLFOnReception off
Thanks,
Heyi
Quoted 88 lines · Heyi Guo
Quoted 4 lines · Heyi Guo
Hi Spencer,
Thanks for your info; I check my configuration file and it is almost the same with the one you post, except for below items:
Quoted 8 lines
- SysSock.Use="off"
- UseSpecialParser="off"
- ParseHostname="off"
However the trailing LF of each transfer is still dropped in the target file.
I mean the issue is still there after adding the above 3 items to configuration file.
Heyi
Quoted 69 lines
Any other ideas?
PS: We are using the version of rsyslog from openbmc 2.10.0-rc1.
Thanks,
Heyi
Quoted 58 lines · Spencer Ku (古世瑜)
Hi Heyi,
Phosphor-hostlooger in stream mode forwards the byte stream into rsyslog via the imuxsock module. The log is persisted via the omfile module as soon as collected. So we need to use imuxsock module to transfer the data. The below sample is my rsyslog settings:
module(load="imuxsock" SysSock.Use="off")
template(name="ConsoleTemplate" type="string" string="%rawmsg%")
ruleset(name="ConsoleRuleset"){
action(type="omfile" file="/var/log/console/log" template="ConsoleTemplate")}# Custom socket for serial console logs.
input(type="imuxsock"
Socket="/run/rsyslog/console_input"
CreatePath="on"
UseSpecialParser="off"
ParseHostname="off"
ruleset="ConsoleRuleset")$EscapeControlCharactersOnReceive off
And we also need to set the socket path to hostlogger
config(STREAM_DST). In this sample, the path is/run/rsyslog/console_inputHope this information is helpful to you.Sincerely,
Spencer KuQuoted 30 lines
-----Original Message-----
From: openbmc <[email protected]> On Behalf Of Heyi Guo
Sent: Friday, February 25, 2022 4:07 PM
To: openbmc <[email protected]>
Cc: Alexander Amelkin <[email protected]>; Artem Senichev <[email protected]>; Alexander Filippov <[email protected]>
Subject: [hostlogger] Trailing LF is dropped from host logger to rsyslogHi all,
We are using hostlogger in stream mode and forwarding the serial port data to rsyslog. rsyslog template is as below:
$EscapeControlCharactersOnReceive off
template(name="hostlog" type="string"
string="%rawmsg%"
)However it seems the trailing LF "\n" of each socket transfer will be dropped when saving the messages to file, causing multiple lines joined together and hard to read.
Is there anything wrong in our configuration?
Thanks,
Heyi