NXlog ignores multiline tomcat stacktraces while sending to Papertrail

拥有回忆 提交于 2019-12-13 05:19:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!