# How to Parse the XML logs in Logstash and Convert into Json

**URL:** <https://discuss.elastic.co/t/how-to-parse-the-xml-logs-in-logstash-and-convert-into-json/302035>\
**Category:** Logstash\
**Created:** [April 9, 2022, 5:41pm UTC](https://discuss.elastic.co/t/how-to-parse-the-xml-logs-in-logstash-and-convert-into-json/302035 "2022-04-09T17:41:31Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [April 9, 2022, 6:27pm UTC](https://discuss.elastic.co/t/how-to-parse-the-xml-logs-in-logstash-and-convert-into-json/302035/4 "2022-04-09T18:27:26Z")

</div>

You may need to use a [multiline codec](https://www.elastic.co/guide/en/logstash/current/plugins-codecs-multiline.html) to combine lines so that the entire XML object is in a single event, then use an [xml filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-xml.html) to parse it.

There are many threads that discuss this. [Here](https://discuss.elastic.co/t/console-xml-works-but-not-file-xml/206645) is one.

---

_[View the full topic](https://discuss.elastic.co/t/how-to-parse-the-xml-logs-in-logstash-and-convert-into-json/302035)._
