# Help Logstash XML Parsing to Xpath

**URL:** <https://discuss.elastic.co/t/help-logstash-xml-parsing-to-xpath/241051>\
**Category:** Logstash\
**Created:** [July 14, 2020, 4:17am UTC](https://discuss.elastic.co/t/help-logstash-xml-parsing-to-xpath/241051 "2020-07-14T04:17:24Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 13, 2020, 11:04pm UTC](https://discuss.elastic.co/t/help-logstash-xml-parsing-to-xpath/241051/21 "2020-08-13T23:04:26Z")

</div>

That could work.

---

<div class="post-metadata">

**Author:** ![akim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akim/32/46439_2.png) [@akim](https://discuss.elastic.co/u/akim)\
**Post date:** [August 14, 2020, 8:42am UTC](https://discuss.elastic.co/t/help-logstash-xml-parsing-to-xpath/241051/22 "2020-08-14T08:42:19Z")

</div>

Still having the same issue.  
Looks like the .xml file is not fully stored as @metadata?  
Is there a way to keep xml files as it is as it cannot process entirely.

---

<div class="post-metadata">

**Author:** ![akim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akim/32/46439_2.png) [@akim](https://discuss.elastic.co/u/akim)\
**Post date:** [August 14, 2020, 10:06am UTC](https://discuss.elastic.co/t/help-logstash-xml-parsing-to-xpath/241051/23 "2020-08-14T10:06:52Z")

</div>

This is the error I'm having.

```auto
[2020-08-14T10:06:30,324][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9600}
[2020-08-14T10:06:31,594][WARN][logstash.filters.xml][main][5db384a5d4febe6da0346e111110199b81be900ee54139af298df60329b91b9a] Error parsing xml with XmlSimple {:source=>"message", :value=>"<NewData>\n <Data ID=\"1234\" OtherID=\"48\" Description=\"This is a sample\" Type=\"Inside\" Instructions=\"Only Here\" OtherInstructions=\"NONE\">\n <EntryDate>\n <CCYY>2020</CCYY>\n <Month>4</Month>\n <Day>13</Day>\n </EntryDate>\n <OutDate>\n <CCYY>2020</CCYY>\n <Month>4</Month>\n <Day>13</Day>\n </OutDate>\n <ClientConfig>\n <ClientSetting name=\"Some_Value1\">true</ClientSetting>\n <ClientSetting name=\"Some_Value2\">true</ClientSetting>\n <ClientSetting name=\"Some_Value3\">true</ClientSetting>\n <ClientSetting name=\"Some_Value4\">true</ClientSetting>\n <ClientSetting name=\"Some_Value5\">true</ClientSetting>\n </ClientConfig>\n\t</Data>\n<Document ID=\"1\" Type=\"-1\" Description=\"XXX\" Instructions=\"THIS\">\n <Text> Some text here \n </Text>\n </Document>\n <Document ID=\"2\" Type=\"-1\" Description=\"YYY\" Instructions=\"THIS\">\n <Text> \nSome Text here B \n </Text>\n </Document>", :exception=>#<REXML::ParseException: No close tag for /NewData
Line: 29
Position: 947
Last 80 unconsumed characters:
>, :backtrace=>["uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rexml/parsers/treeparser.rb:28:in `parse'", "uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rexml/document.rb:288:in `build'", "uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rexml/document.rb:45:in `initialize'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/xml-simple-1.1.5/lib/xmlsimple.rb:971:in `parse'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/xml-simple-1.1.5/lib/xmlsimple.rb:164:in `xml_in'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/xml-simple-1.1.5/lib/xmlsimple.rb:203:in `xml_in'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-xml-4.1.0/lib/logstash/filters/xml.rb:195:in `filter'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:159:in `do_filter'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:178:in `block in multi_filter'", "org/jruby/RubyArray.java:1809:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:175:in `multi_filter'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:134:in `multi_filter'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:278:in `block in start_workers'"]}

```

---

<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:** [September 11, 2020, 10:07am UTC](https://discuss.elastic.co/t/help-logstash-xml-parsing-to-xpath/241051/24 "2020-09-11T10:07:15Z")

</div>

Closed on September 11, 2020, 10:07am UTC

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

[Previous page](https://discuss.elastic.co/t/help-logstash-xml-parsing-to-xpath/241051.md?page=1)
