# Logstash xml split filter

**URL:** <https://discuss.elastic.co/t/logstash-xml-split-filter/141154>\
**Category:** Logstash\
**Created:** [July 23, 2018, 11:22am UTC](https://discuss.elastic.co/t/logstash-xml-split-filter/141154 "2018-07-23T11:22:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naveen\_Reddy\_Sama](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/naveen_reddy_sama/32/32399_2.png) [@Naveen\_Reddy\_Sama](https://discuss.elastic.co/u/Naveen_Reddy_Sama)\
**Post date:** [July 23, 2018, 11:22am UTC](https://discuss.elastic.co/t/logstash-xml-split-filter/141154/1 "2018-07-23T11:22:26Z")

</div>

Hi team,

using the below logstash confg file xml filter

> filter {  
> xml {  
> source =\> "message"  
> target =\> "xml\_content"  
> }  
> split {  
> field =\> "xml\_content[station]"  
> }  
> split {  
> field =\> "xml\_content[station][name]"  
> }  
> mutate {  
> add\_field =\> { "lastupdate" =\> "%{xml\_content[lastupdate]}" }  
> add\_field =\> { "name" =\> "%{xml\_content[station][name][name]}" }  
> remove\_field =\> ['xml\_content', 'message', 'path']  
> }  
> }

getting invalid results check in kibana results

> tags:multiline, \_xmlparsefailure, \_split\_type\_failure @timestamp:July 23rd 2018, 16:42:16.662 name:%{xml\_content[station][name][name]} @version:1 lastupdate:%{xml\_content[lastupdate]} \_id:GmfXxmQBPb0XzgMOBBMj \_type:doc \_index:xmltest \_score: -

can anyone help me on this thanks in advance

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 23, 2018, 11:38am UTC](https://discuss.elastic.co/t/logstash-xml-split-filter/141154/2 "2018-07-23T11:38:22Z")

</div>

Thread moved to #logstash

---

<div class="post-metadata">

**Author:** ![Naveen\_Reddy\_Sama](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/naveen_reddy_sama/32/32399_2.png) [@Naveen\_Reddy\_Sama](https://discuss.elastic.co/u/Naveen_Reddy_Sama)\
**Post date:** [July 23, 2018, 11:47am UTC](https://discuss.elastic.co/t/logstash-xml-split-filter/141154/3 "2018-07-23T11:47:41Z")

</div>

Hi Dadoonet  
can you please explain me in detail.

---

<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:** [July 23, 2018, 12:10pm UTC](https://discuss.elastic.co/t/logstash-xml-split-filter/141154/4 "2018-07-23T12:10:43Z")

</div>

It is failing to parse the message as xml. What does the message look like? Comment out the remove\_field until you are sure things are working correctly.

---

<div class="post-metadata">

**Author:** ![Naveen\_Reddy\_Sama](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/naveen_reddy_sama/32/32399_2.png) [@Naveen\_Reddy\_Sama](https://discuss.elastic.co/u/Naveen_Reddy_Sama)\
**Post date:** [July 23, 2018, 12:18pm UTC](https://discuss.elastic.co/t/logstash-xml-split-filter/141154/5 "2018-07-23T12:18:25Z")

</div>

Hi Badger,  
if i uncommented remove\_field it is passing all the xml file as in message, i need to display/split only those filtered values in kibana

Thanks!

---

<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:** [July 23, 2018, 12:42pm UTC](https://discuss.elastic.co/t/logstash-xml-split-filter/141154/6 "2018-07-23T12:42:36Z")

</div>

Once again, what does the message look like? Either paste from the JSON tab in Kibana/Discover or add stdout { codec =\> rubydebug } }

---

<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:** [August 20, 2018, 12:50pm UTC](https://discuss.elastic.co/t/logstash-xml-split-filter/141154/7 "2018-08-20T12:50:00Z")

</div>

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