# Logstash XML Parsing Using multiline

**URL:** <https://discuss.elastic.co/t/logstash-xml-parsing-using-multiline/32889>\
**Category:** Logstash\
**Created:** [October 23, 2015, 9:52pm UTC](https://discuss.elastic.co/t/logstash-xml-parsing-using-multiline/32889 "2015-10-23T21:52:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![samnik60](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@samnik60](https://discuss.elastic.co/u/samnik60)\
**Post date:** [October 23, 2015, 9:52pm UTC](https://discuss.elastic.co/t/logstash-xml-parsing-using-multiline/32889/1 "2015-10-23T21:52:50Z")

</div>

I am trying to parse an xml file as shown below

[http://pastebin.com/SgX5gYY2](http://pastebin.com/SgX5gYY2)

i tried to use the multiline filter of logstash as

```
multiline {
  pattern => ".*</LogMessage>"
  negate => true
  what => "previous"
}

```

It is not giving me correct parsing but if i use

```
multiline {
  pattern => ".*</LogMessage>"
  negate => true
  what => "next"
}

```

it parses perfectly , Now according to my understanding if the pattern matches then it need to be configured to be included to "previous" but specifying "next" works, i am misunderstanding something here ?

Thanks,  
sam

---

<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, 5:25am UTC](https://discuss.elastic.co/t/logstash-xml-parsing-using-multiline/32889/2 "2017-07-06T05:25:33Z")

</div>


