Need a complete XML Filter example

Hi,

I am new to Logstash and I have a requirement where i have to read a xml file from my windows machine and index to ES.

The XML file looks like the one in the attached image....


Could someone please give me a reference or solution on how i could achieve this?

Thanks in advance :slight_smile:

1 Like

Have you seen https://www.elastic.co/guide/en/logstash/current/plugins-filters-xml.html?

Hi Mark,

I have looked into the plugin filters for xml, but i failed to get an working example to index an XML.

The link does not have an working example, could you please help?

Regards,
Abdul

Hi Abdul,

have you seen this topic ?
https://discuss.elastic.co/t/help-with-parsing-xml-content/27445/3

It's been usefull for me to understand Xpath to parse xml..

You should be have something like

filter {
       xml {
              source => "yourxml"
              store_xml => false
              xpath => ["/testResults/httpSample/@t", "t_value"]
              xpath => ["/testResults/httpSample/@ts", "ts_value"]
 [......]        

Regards,
Mr.Nice

2 Likes