Parsing xml parameters & values separated on new line

Hi,

I am trying to parse below xml file wherein parameter name & value is covered in 2 different tags. I am looking for guidance on how to parse this xml data using logstash ?

<values>
<id1>parameter-1</id1>
<id>10</id>
</values>
<values>
<id1>parameter-2</id1>
<id>20</id>
</values>

I want to insert parameter name & respective value in ES for indexing/queries.

Please guide

You could use a file input with a multiline codec

codec => multiline { pattern => '</values>' negate => true what => "next" auto_flush_interval => 1 }

Then parse it using an xml filter

xml { source => "message" target => "theXML" }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.