# Not able to parse custom logs having multi line xml

**URL:** <https://discuss.elastic.co/t/not-able-to-parse-custom-logs-having-multi-line-xml/107743>\
**Category:** Logstash\
**Created:** [November 15, 2017, 12:23pm UTC](https://discuss.elastic.co/t/not-able-to-parse-custom-logs-having-multi-line-xml/107743 "2017-11-15T12:23:25Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [November 16, 2017, 2:54pm UTC](https://discuss.elastic.co/t/not-able-to-parse-custom-logs-having-multi-line-xml/107743/7 "2017-11-16T14:54:52Z")

</div>

Previous discussions.

> [@Filebeat Process multilne XML](https://discuss.elastic.co/t/filebeat-process-multilne-xml/77761):
>
> I have a log file where I am printing request and response XML bodies. This log file also has some additional lines that are not XML. Example below -- =========================================== \<request\> \<data\> abc \</data\> \</request\> some random lines concerning the processing of request.. fha;js;fkgak;gj;kj;a jgahkg;gaj; Now response follows \<response\> \<output\> def \</output\> \</response\> =================================================== How to use use filebeat multiline fe…

> [@How to configure FileBeat and Logstash to add XML Files in Elasticsearch?](https://discuss.elastic.co/t/how-to-configure-filebeat-and-logstash-to-add-xml-files-in-elasticsearch/86315):
>
> Hi everybody, I'm a beginner here. My own problem is to configure FileBeat and Logstash to add XML Files in Elasticsearch on CentOS 7. I have already install the last version of filebeat, logstash, elasticsearch and Kibana, with the plug-in "elasticsearch-head" in standalone to see inside elasticsearch. And to test my installation, i have successfully add simple log file from CentOS system (/var/log/messages), and see it inside elasticsearch-head plug-in (6 index and 26 shards): And …

As you can see, this kind of thing is really hard to get 100% right. Most of the time the worst problem is that the very last character in the file is not a newline.

Another possibility is to use a python script preprocessor to read a whole file and append a minified XML string to another file that filebeat will tail.  
A partial solution. [python - Remove whitespaces in XML string - Stack Overflow](https://stackoverflow.com/a/3317008/5349531)

---

_[View the full topic](https://discuss.elastic.co/t/not-able-to-parse-custom-logs-having-multi-line-xml/107743)._
