# Not able to parse xml

**URL:** <https://discuss.elastic.co/t/not-able-to-parse-xml/144673>\
**Category:** Logstash\
**Created:** [August 16, 2018, 9:31am UTC](https://discuss.elastic.co/t/not-able-to-parse-xml/144673 "2018-08-16T09:31:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavan\_padaki](https://avatars.discourse-cdn.com/v4/letter/p/8edcca/32.png) [@pavan\_padaki](https://discuss.elastic.co/u/pavan_padaki)\
**Post date:** [August 16, 2018, 9:31am UTC](https://discuss.elastic.co/t/not-able-to-parse-xml/144673/1 "2018-08-16T09:31:50Z")

</div>

logstash-6.3.1\bin\logstash -f xml\_config.conf  
Ignoring the 'pipelines.yml' file because modules or command line options are specified  
Starting Logstash {"logstash.version"=\>"6.3.1"}  
[logstash.outputs.elasticsearch] You are using a deprecated config setting "document\_type" set in elasticsearch. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. Document types are being deprecated in Elasticsearch 6.0, and removed entirely in 7.0. You should avoid this feature If you have any questions about this, please visit the #logstash channel on freenode irc. {:name=\>"document\_type", :plugin=\>\<LogStash::Outputs::ElasticSearch hosts=\>[[http://localhost:9200](http://localhost:9200)], bulk\_path=\>"/\_xpack/monitoring/\_bulk?  
[logstash.pipeline] Starting pipeline {:pipeline\_id=\>".monitoring-logstash", "pipeline.workers"=\>1, "pipeline.batch.size"=\>2, "pipeline.batch.delay"=\>50}  
[logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=\>{:removed=\>[], :added=\>[[http://localhost:9200/](http://localhost:9200/)]}}  
][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck\_url=\>[http://localhost:9200/](http://localhost:9200/), :path=\>"/"}  
[logstash.outputs.elasticsearch] Restored connection to ES instance {:url=\>"[http://localhost:9200/](http://localhost:9200/)"}  
[logstash.outputs.elasticsearch] ES Output version determined {:es\_version=\>6}  
[logstash.outputs.elasticsearch] Detected a 6.x and above cluster: the `type` event field won't be used to determine the document \_type {:es\_version=\>6}  
[logstash.outputs.elasticsearch] New Elasticsearch output {:class=\>"LogStash::Outputs::ElasticSearch", :hosts=\>["[http://localhost:9200](http://localhost:9200)"]}  
[logstash.licensechecker.licensereader] Elasticsearch pool URLs updated {:changes=\>{:removed=\>[], :added=\>[[http://localhost:9200/](http://localhost:9200/)]}}  
[logstash.licensechecker.licensereader] Running health check to see if an Elasticsearch connection is working {:healthcheck\_url=\>[http://localhost:9200/](http://localhost:9200/), :path=\>"/"}  
[WARN][logstash.licensechecker.licensereader] Restored connection to ES instance {:url=\>"[http://localhost:9200/](http://localhost:9200/)"}  
[INFO][logstash.licensechecker.licensereader] ES Output version determined {:es\_version=\>6}  
[WARN][logstash.licensechecker.licensereader] Detected a 6.x and above cluster: the `type` event field won't be used to determine the document \_type {:es\_version=\>6}  
[INFO][logstash.pipeline] Pipeline started successfully {:pipeline\_id=\>".monitoring-logstash", :thread=\>"#\<Thread:0x64b9ea63 sleep\>"}  
[WARN][logstash.outputs.elasticsearch] You are using a deprecated config setting "document\_type" set in elasticsearch. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. Document types are being deprecated in Elasticsearch 6.0, and removed entirely in 7.0. You should avoid this feature If you have any questions about this, please visit the #logstash channel on freenode irc. {:name=\>"document\_type", :plugin=\>\<LogStash::Outputs::ElasticSearch index=\>"logstash-xml", hosts=\>[[http://localhost:9200](http://localhost:9200)], document\_id=\>"%{[id]}", document\_type=\>"xmlfiles", id=\>"f9ab15d8311863d0ea22e720d3a14723bb0261c2614df8b508cc6c50a481fe9a", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_8d870370-23c6-41fd-bd3d-f27e7a47d6fb", enable\_metric=\>true, charset=\>"UTF-8"\>, workers=\>1, manage\_template=\>true, template\_name=\>"logstash", template\_overwrite=\>false, doc\_as\_upsert=\>false, script\_type=\>"inline", script\_lang=\>"painless", script\_var\_name=\>"event", scripted\_upsert=\>false, retry\_initial\_interval=\>2, retry\_max\_interval=\>64, retry\_on\_conflict=\>1, action=\>"index", ssl\_certificate\_verification=\>true, sniffing=\>false, sniffing\_delay=\>5, timeout=\>60, pool\_max=\>1000, pool\_max\_per\_route=\>100, resurrect\_delay=\>5, validate\_after\_inactivity=\>10000, http\_compression=\>false\>}  
[INFO][logstash.pipeline] Starting pipeline {:pipeline\_id=\>"main", "pipeline.workers"=\>8, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>50}  
[INFO][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=\>{:removed=\>[], :added=\>[[http://localhost:9200/](http://localhost:9200/)]}}  
[INFO][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck\_url=\>[http://localhost:9200/](http://localhost:9200/), :path=\>"/"}  
[WARN][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=\>"[http://localhost:9200/](http://localhost:9200/)"}  
[INFO][logstash.outputs.elasticsearch] ES Output version determined {:es\_version=\>6}  
[WARN][logstash.outputs.elasticsearch] Detected a 6.x and above cluster: the `type` event field won't be used to determine the document \_type {:es\_version=\>6}  
[INFO][logstash.outputs.elasticsearch] New Elasticsearch output {:class=\>"LogStash::Outputs::ElasticSearch", :hosts=\>["[http://localhost:9200](http://localhost:9200)"]}  
[INFO][logstash.outputs.elasticsearch] Using mapping template from {:path=\>nil}  
[INFO][logstash.outputs.elasticsearch] Attempting to install template {:manage\_template=\>{"template"=\>"logstash-_", "version"=\>60001, "settings"=\>{"index.refresh\_interval"=\>"5s"}, "mappings"=\>{"default"=\>{"dynamic\_templates"=\>[{"message\_field"=\>{"path\_match"=\>"message", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false}}}, {"string\_fields"=\>{"match"=\>"_", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false, "fields"=\>{"keyword"=\>{"type"=\>"keyword", "ignore\_above"=\>256}}}}}], "properties"=\>{"@timestamp"=\>{"type"=\>"date"}, "@version"=\>{"type"=\>"keyword"}, "geoip"=\>{"dynamic"=\>true, "properties"=\>{"ip"=\>{"type"=\>"ip"}, "location"=\>{"type"=\>"geo\_point"}, "latitude"=\>{"type"=\>"half\_float"}, "longitude"=\>{"type"=\>"half\_float"}}}}}}}}  
[logstash.pipeline] Pipeline started successfully {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0x6a2ecc5d@C:/Users/yp104e/Documents/ELK/logstash-6.3.1/logstash-core/lib/logstash/pipeline\_action/create.rb:48 sleep\>"}  
[logstash.agent] Pipelines running {:count=\>2, :running\_pipelines=\>[:main, :".monitoring-logstash"], :non\_running\_pipelines=\>[]}  
[INFO][logstash.inputs.metrics] Monitoring License OK  
[INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}

I can't see any json created further  
Below is the configuration I am using

input {  
file {  
path =\> "C:\Users\yp104e\Documents\ELK\sample.xml"  
start\_position =\> beginning  
codec =\> multiline  
{  
pattern =\> "^\<?xmldata .\*\>"  
negate =\> true  
what =\> "previous"  
}  
}  
}  
filter {  
xml {  
target =\> "doc"  
store\_xml =\> false  
source =\> "message"  
xpath =\>  
[  
"/xmldata/head1/id/text()", "id",  
"/xmldata/head1/date/text()", "date",  
"/xmldata/head1/key1/text()", "key1"  
]  
}  
}  
output {  
stdout { codec =\> rubydebug }  
elasticsearch {  
index =\> "logstash-xml"  
hosts =\> ["[http://localhost:9200](http://localhost:9200)"]  
document\_id =\> "%{[id]}"  
document\_type =\> "xmlfiles"  
}

---

<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:** [August 16, 2018, 10:29am UTC](https://discuss.elastic.co/t/not-able-to-parse-xml/144673/2 "2018-08-16T10:29:52Z")

</div>

Perhaps you need to clear the sincedb file or set `sincedb_path` to "nul" in order to disable sincedb. See the file input documentation for more information.

---

<div class="post-metadata">

**Author:** ![pavan\_padaki](https://avatars.discourse-cdn.com/v4/letter/p/8edcca/32.png) [@pavan\_padaki](https://discuss.elastic.co/u/pavan_padaki)\
**Post date:** [August 20, 2018, 6:25am UTC](https://discuss.elastic.co/t/not-able-to-parse-xml/144673/3 "2018-08-20T06:25:27Z")

</div>

Even after setting `sincedb_path => /dev/null` still I am getting the same problem

---

<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:** [August 20, 2018, 7:10am UTC](https://discuss.elastic.co/t/not-able-to-parse-xml/144673/4 "2018-08-20T07:10:30Z")

</div>

A `sincedb_path` value of /dev/null only works as expected on non-Windows machines. On Windows use "nul" as I wrote.

But that's probably not the problem anyway. Have you tried setting the multiline codec's `auto_flush_interval` option to something low, like 5?

---

<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 17, 2018, 7:10am UTC](https://discuss.elastic.co/t/not-able-to-parse-xml/144673/5 "2018-09-17T07:10:32Z")

</div>

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