# Logstash 6.1: XML parsing doesn't work

**URL:** <https://discuss.elastic.co/t/logstash-6-1-xml-parsing-doesnt-work/114218>\
**Category:** Logstash\
**Created:** [January 5, 2018, 6:58am UTC](https://discuss.elastic.co/t/logstash-6-1-xml-parsing-doesnt-work/114218 "2018-01-05T06:58:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saket\_Kumar](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Saket\_Kumar](https://discuss.elastic.co/u/Saket_Kumar)\
**Post date:** [January 5, 2018, 6:58am UTC](https://discuss.elastic.co/t/logstash-6-1-xml-parsing-doesnt-work/114218/1 "2018-01-05T06:58:25Z")

</div>

I am extracting array tags from xml . the defined xpath doesn't capture.

Config file:  
input {  
stdin {  
type =\> "02Jan2018122417\_180102\_3R\_3dd37a7cf4a843a6dc90e56822b31fe6\_Swissotel-Desktop\_WebpageSummary.xml"  
codec =\> multiline {  
pattern =\> "|"  
negate =\> true  
what =\> "previous"  
max\_lines =\> "5000"  
max\_bytes =\> "100 MB"  
}  
}  
}

```
filter {
   if [message] =~ "^<\?xml .*" {
    drop {}
  }
  
  xml {
       source => "message"
       target => "xml_content"
       force_content => "true"
	store_xml => false
	xpath => ["/response/data/run/firstView/videoFrames/frame[*]/time/text()","Time_FV"]
	xpath => ["/response/data/run/firstView/videoFrames/frame[*]/image/text()","Image_FV"]
	xpath => ["/response/data/run/firstView/videoFrames/frame[*]/VisuallyComplete/text()","Progress_FV"]
	}
}

output { 
	   stdout { codec => rubydebug }
}

```

Any idea whats wrong here?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 6, 2018, 10:28am UTC](https://discuss.elastic.co/t/logstash-6-1-xml-parsing-doesnt-work/114218/2 "2018-01-06T10:28:42Z")

</div>

How do you expect us to answer without knowing what the XML document looks like? Show us the output of `stdout { codec => rubydebug }`.

---

<div class="post-metadata">

**Author:** ![Saket\_Kumar](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Saket\_Kumar](https://discuss.elastic.co/u/Saket_Kumar)\
**Post date:** [January 15, 2018, 11:44am UTC](https://discuss.elastic.co/t/logstash-6-1-xml-parsing-doesnt-work/114218/3 "2018-01-15T11:44:58Z")

</div>

Thanks Magnus for your interest and sorry for half of the information passed. However found the root cause in the source XML file only. Tag was broken due to which logstash was unable to read the xpath. after rectifying the tags it works.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 12, 2018, 11:45am UTC](https://discuss.elastic.co/t/logstash-6-1-xml-parsing-doesnt-work/114218/4 "2018-02-12T11:45:09Z")

</div>

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