# Parse XML out of message section in document

**URL:** <https://discuss.elastic.co/t/parse-xml-out-of-message-section-in-document/307049>\
**Category:** Elasticsearch\
**Created:** [June 13, 2022, 2:54pm UTC](https://discuss.elastic.co/t/parse-xml-out-of-message-section-in-document/307049 "2022-06-13T14:54:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lpfriedmann](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@lpfriedmann](https://discuss.elastic.co/u/lpfriedmann)\
**Post date:** [June 13, 2022, 2:54pm UTC](https://discuss.elastic.co/t/parse-xml-out-of-message-section-in-document/307049/1 "2022-06-13T14:54:44Z")

</div>

Hi Everyone,  
I have gone through alot of the XML parsing threads and none of them really match what I am wanting to do. So when I search and a document is returned, if there there is an XML associated to the document, we store the XML in the message section. Is there a way to just parse the XML out of the message section in a document? Thanks, we just started using Elastic and have not quite figured a way out to do this yet.

---

<div class="post-metadata">

**Author:** ![grumo35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grumo35/32/59451_2.png) [@grumo35](https://discuss.elastic.co/u/grumo35)\
**Post date:** [June 13, 2022, 4:19pm UTC](https://discuss.elastic.co/t/parse-xml-out-of-message-section-in-document/307049/2 "2022-06-13T16:19:06Z")

</div>

Hi,

Sure you can use logstash [Xml filter plugin | Logstash Reference [8.2] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-filters-xml.html)

You can check beforehand if your document contains xml by simple regex or specific rules based on your dataset.

---

<div class="post-metadata">

**Author:** ![lpfriedmann](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@lpfriedmann](https://discuss.elastic.co/u/lpfriedmann)\
**Post date:** [June 13, 2022, 5:57pm UTC](https://discuss.elastic.co/t/parse-xml-out-of-message-section-in-document/307049/3 "2022-06-13T17:57:36Z")

</div>

OK, that might be my issue, I don't think we have the logstash package installed. I would see a logstash area under the dev tools correct?

---

<div class="post-metadata">

**Author:** ![grumo35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grumo35/32/59451_2.png) [@grumo35](https://discuss.elastic.co/u/grumo35)\
**Post date:** [June 14, 2022, 7:33am UTC](https://discuss.elastic.co/t/parse-xml-out-of-message-section-in-document/307049/4 "2022-06-14T07:33:23Z")

</div>

Hi,

Well Logstash is supposed to be playing a role before the ingest of data by Elasticsearch, you can do multiple things.

You're ingesting data through an Elasticsearch input pipeline ?

I wasnt trying to confuse you logstash is a completly sperate component from Elasticsearch.

---

<div class="post-metadata">

**Author:** ![lpfriedmann](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@lpfriedmann](https://discuss.elastic.co/u/lpfriedmann)\
**Post date:** [June 28, 2022, 1:27pm UTC](https://discuss.elastic.co/t/parse-xml-out-of-message-section-in-document/307049/5 "2022-06-28T13:27:29Z")

</div>

Thanks for the input, I was not included on how our orgs Elasticsearch is set up. I guess I need to do some more digging before I really try anything else. Thanks again.

---

<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 26, 2022, 1:27pm UTC](https://discuss.elastic.co/t/parse-xml-out-of-message-section-in-document/307049/6 "2022-07-26T13:27:51Z")

</div>

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