0

I'm learning nxlog but there aren't may examples of parsing xml input in the current docs.

My input lines look like this:

<Msg time='2014-06-27T00:27:38' type='ERROR' code='5000' target='Some.Target' machine='DEV-Machine' process='2408' thread='160' elapsed='0.00000'>The message.</Msg>

I have

<Input my_input>
  Module      im_file
  File        'C:\logs\\*.dat'
  Exec        parse_xml(); to_json();
</Input>

Which produces only:

{"EventReceivedTime":"2014-06-27 01:13:28","SourceModuleName":"my_input","SourceModuleType":"im_file"}

How do I get the attributes into json fields?

Andy Arismendi
  • 50,577
  • 16
  • 107
  • 124

1 Answers1

2

Unfortunately there is no support for parsing xml attributes or nested xml currently via the xm_xml extension module. There is xm_perl which you could use for this kind of complex xml parsing (available for Linux only).

b0ti
  • 2,319
  • 1
  • 18
  • 18