# XML parsing logstash

**URL:** https://discuss.elastic.co/t/xml-parsing-logstash/143798
**Category:** Logstash
**Created:** [August 10, 2018, 5:18am UTC](https://discuss.elastic.co/t/xml-parsing-logstash/143798 "2018-08-10T05:18:49Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Josh\_Vj](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@Josh\_Vj](https://discuss.elastic.co/u/Josh_Vj)
#### Post date: [August 10, 2018, 5:18am UTC](https://discuss.elastic.co/t/xml-parsing-logstash/143798/1 "2018-08-10T05:18:49Z")

</div>

Hi all,

I am currently using file beat to export all the below messages from application logs (XML) to ECS. But i like to parse the xml so only few required details are viewed in ECS.

I like to get the value of below tags by only filtering Message name, Ref ID, duration, time value in request/response and discard rest of the XML.

How can achieve that? Please assist.

 Update server01 1234 http:\\server.com server 39 00:00:00.1220000 2018-08-09 00:05:10.41 this is a message\<\rawmessage\> 2018-08-09 00:05:10.532 this is a message\<\rawmessage\>

---

<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 10, 2018, 5:51am UTC](https://discuss.elastic.co/t/xml-parsing-logstash/143798/2 "2018-08-10T05:51:48Z")

</div>

Have you looked at the xml filter? It's xpath option should be useful if you only want to extract a couple of fields from the document.

---

<div class="post-metadata">

### Author: ![Josh\_Vj](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@Josh\_Vj](https://discuss.elastic.co/u/Josh_Vj)
#### Post date: [August 13, 2018, 5:22am UTC](https://discuss.elastic.co/t/xml-parsing-logstash/143798/3 "2018-08-13T05:22:33Z")

</div>

> [@magnusbaeck](#):
>
> xml filter

Is there an example i can follow?

---

<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 13, 2018, 6:11am UTC](https://discuss.elastic.co/t/xml-parsing-logstash/143798/4 "2018-08-13T06:11:12Z")

</div>

I searched [discuss.elastic.co](http://discuss.elastic.co) for "xml filter xpath" and the first hit contained an example: [XML XPath filter is parsing fields but not inserting in Elasticsearch](https://discuss.elastic.co/t/xml-xpath-filter-is-parsing-fields-but-not-inserting-in-elasticsearch/123910)

---

<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 10, 2018, 6:11am UTC](https://discuss.elastic.co/t/xml-parsing-logstash/143798/5 "2018-09-10T06:11:14Z")

</div>

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