# Need a complete XML Filter example

**URL:** <https://discuss.elastic.co/t/need-a-complete-xml-filter-example/35398>\
**Category:** Logstash\
**Created:** [November 24, 2015, 8:59am UTC](https://discuss.elastic.co/t/need-a-complete-xml-filter-example/35398 "2015-11-24T08:59:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammed\_Abdul\_Khali](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Mohammed\_Abdul\_Khali](https://discuss.elastic.co/u/Mohammed_Abdul_Khali)\
**Post date:** [November 24, 2015, 8:59am UTC](https://discuss.elastic.co/t/need-a-complete-xml-filter-example/35398/1 "2015-11-24T08:59:37Z")

</div>

Hi,

I am new to Logstash and I have a requirement where i have to read a xml file from my windows machine and index to ES.

The XML file looks like the one in the attached image....

 ![](https://us1.discourse-cdn.com/elastic/original/2X/6/6cab5bed8c79e08697a957e6a5920db4f76f3377.jpg)  
Could someone please give me a reference or solution on how i could achieve this?

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 24, 2015, 9:11pm UTC](https://discuss.elastic.co/t/need-a-complete-xml-filter-example/35398/2 "2015-11-24T21:11:44Z")

</div>

Have you seen [https://www.elastic.co/guide/en/logstash/current/plugins-filters-xml.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-xml.html)?

---

<div class="post-metadata">

**Author:** ![Mohammed\_Abdul\_Khali](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Mohammed\_Abdul\_Khali](https://discuss.elastic.co/u/Mohammed_Abdul_Khali)\
**Post date:** [December 1, 2015, 7:07am UTC](https://discuss.elastic.co/t/need-a-complete-xml-filter-example/35398/3 "2015-12-01T07:07:41Z")

</div>

Hi Mark,

I have looked into the plugin filters for xml, but i failed to get an working example to index an XML.

The link does not have an working example, could you please help?

Regards,  
Abdul

---

<div class="post-metadata">

**Author:** ![Mr.Nice](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mr.nice/32/11458_2.png) [@Mr.Nice](https://discuss.elastic.co/u/Mr.Nice)\
**Post date:** [August 18, 2016, 3:09pm UTC](https://discuss.elastic.co/t/need-a-complete-xml-filter-example/35398/4 "2016-08-18T15:09:49Z")

</div>

Hi Abdul,

have you seen this topic ?  
[https://discuss.elastic.co/t/help-with-parsing-xml-content/27445/3](https://discuss.elastic.co/t/help-with-parsing-xml-content/27445/3)

It's been usefull for me to understand Xpath to parse xml..

You should be have something like

> ```
> filter {
> xml {
> source => "yourxml"
> store_xml => false
> xpath => ["/testResults/httpSample/@t", "t_value"]
> xpath => ["/testResults/httpSample/@ts", "ts_value"]
> [......]        
> 
> ```

Regards,  
Mr.Nice

---

<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:** [July 6, 2017, 4:42am UTC](https://discuss.elastic.co/t/need-a-complete-xml-filter-example/35398/5 "2017-07-06T04:42:46Z")

</div>


