Guidance on parsing this

Notes, tips, and other usefull things on how to use LogMX

Moderator: admin

Post Reply
MajesticJess
Posts: 1
Joined: Fri Feb 02, 2018 1:21 am

Guidance on parsing this

Post by MajesticJess » Fri Feb 02, 2018 1:34 am

Not asking anyone to do this for me, but can someone at least give me some guidance on how to proceed to parse a multi-line message that looks like this?

<log4j:event logger="com.jack.odbservice.DProcessData" timestamp="1516738381079" level="DEBUG" thread="xyz_worker_0">
<log4j:message><![CDATA[> Processing Progress AddFile (widget.dat)]]></log4j:message>
<log4j:NDC><![CDATA[170.2.232.96:ES478E0570]]></log4j:NDC>
</log4j:event>

I would like something like these column/cells/tags per output line:
ID #
timestamp
logger
level
thread
message
NDC

Just using the out-of-the-box stuff I get most of what I want - except that in the Message column I get everything from <log4j:message> to </log4j:NDC>.

Thanks

admin
Site Admin
Posts: 437
Joined: Sun Dec 17, 2006 10:30 pm

Re: Guidance on parsing this

Post by admin » Fri Feb 02, 2018 2:54 am

Hello,

The default Log4j v1 Parser that comes with LogMX doesn't support the NDC part, hence the issues you encountered.
This may be fixed in a future version (also now the focus is more on Log4j v2). So for now, you can create your own Parser: in the menu "File", pick item "Configure Log Parsers...", then click on the "Import" button (bottom right corner), and then import the file attached to this post. Or you can also create a new Parser by clicking on the green "+" button in this same window, and pick "Log4j/Logback pattern Parser", then use this pattern:

Code: Select all

<log4j:event logger="%c" timestamp="%d{SSS}" level="%p" thread="%t">%n<log4j:message><![CDATA[%m]]></log4j:message>%n<log4j:NDC><![CDATA[%x]]></log4j:NDC>%n</log4j:event>
Please let me know if you have any question or problem!

Xavier
Attachments
logmx.parser.export
(492 Bytes) Downloaded 18 times

Post Reply