问题
I am able get the stacktrace[exceptions] from rsyslog (v-8.13.0) to a common nxlog server which sends the logs to a papertrail server. But the nxlog server ignores these multiline logs to papertrail. I know there is a module (xm_multiline) in nxlog which can parse this, but not sure on how to integrate this with my current nxlog configuration file:
########################################
# Global directives #
########################################
User nxlog
Group nxlog
LogFile /var/log/nxlog/nxlog.log
LogLevel INFO
########################################
# Modules #
########################################
<Extension _syslog>
Module xm_syslog
</Extension>
<Input in1>
Module im_udp
Host 0.0.0.0
Port 514
Exec parse_syslog_bsd();
</Input>
<Input in2>
Module im_tcp
HOST 0.0.0.0
Port 1514
</Input>
<Output papertrail>
Module om_udp
Host papertrail.com
Port 24785
</Output>
<Output fileout1>
Module om_file
File "/var/log/nxlog/" + $Hostname + ".log"
Exec if $Message =~ /error/ $SeverityValue = syslog_severity_value("error");
Exec to_syslog_bsd();
</Output>
<Output fileout2>
Module om_file
File "/var/log/nxlog/logmsg2.txt"
</Output>
########################################
# Routes #
########################################
<Route 1>
Path in1 => fileout1,papertrail
</Route>
<Route tcproute>
Path in2 => fileout2
</Route>
Any help would be highly appreciated
回答1:
I am now able to send my logs to papertrail using the following for tomcat stacktrace.
<Extension multiline>
Module xm_multiline
HeaderLine /^/
EndLine //
</Extension>
来源:https://stackoverflow.com/questions/33233633/nxlog-ignores-multiline-tomcat-stacktraces-while-sending-to-papertrail