XML tag filtering


i have an xml file. I use input codec multiline. My filter is an xml xpath filter and output is stdout.
I have a question about xml tag filtering.
The XML structure looks like this:

<tag name="host-ip"></tag>
<tag name="os">linux</tag>

What i need to do, to filter the values or linux of the tag with xpath? I tried different things like

"/service/Report/Properties/tag name='host-ip'/text()","host-ip",

but that brings an error.


Use an Xpath Tester/Evaluator tool online

The XPath expression


will return

the Path expression


will return


the XPath expression


will return

Then one would read all about the xml filter in logstash



hope this xpath expression works for you,


(system) #4

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