# How to use multiline to break up messages delimited with - (hyphen)

**URL:** <https://discuss.elastic.co/t/how-to-use-multiline-to-break-up-messages-delimited-with-hyphen/2378>\
**Category:** Logstash\
**Created:** [June 10, 2015, 7:21pm UTC](https://discuss.elastic.co/t/how-to-use-multiline-to-break-up-messages-delimited-with-hyphen/2378 "2015-06-10T19:21:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaellizhou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaellizhou/32/4143_2.png) [@michaellizhou](https://discuss.elastic.co/u/michaellizhou)\
**Post date:** [June 10, 2015, 7:21pm UTC](https://discuss.elastic.co/t/how-to-use-multiline-to-break-up-messages-delimited-with-hyphen/2378/1 "2015-06-10T19:21:44Z")

</div>

So I am going through this one type of log where some of the messages are broken up by hyphen (-----) for example:

```
    2015-05-01 10:08:08 [http-request] Level Outbound Message
    ------------------------
    ID: 2
    Address: site address
    Encoding: UTF-8
    <soap: Envelope ...>
      <soap: Body>
        <...>
    </soap:...>
    -------------------------------------------

```

I notice right after the message says "outbound" or "inbound" the starting set of hyphens appear followed by the close hyphens. Yes the starting hyphen line is shorter then the closing.

My question is how would you go about using multiline on this type of log? Its not like a stack trace example. The only pattern I notice is the hyphens. Is there a if this amount of hyphens occur add next line until next set of longer hyphens appear? Thanks.

Mike

---

<div class="post-metadata">

**Author:** ![chaitanyavvs](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@chaitanyavvs](https://discuss.elastic.co/u/chaitanyavvs)\
**Post date:** [June 16, 2015, 6:41pm UTC](https://discuss.elastic.co/t/how-to-use-multiline-to-break-up-messages-delimited-with-hyphen/2378/4 "2015-06-16T18:41:56Z")

</div>

Hi Mike,  
I think you might have guessed it out by now. If not, i think if i understand your question, you would want to convert the entire multilines into one event using "multiline filter". If that is the case, then you can ask the filter to say that if any of the line does not start start with a YEAR (`%{YEAR}`) consider it to be a part of the same event.

For ex :  
\> multiline {

> ```
> pattern => "^%{YEAR}"
> negate => true
> what => previous
> }
> 
> ```

I hope i have answered your doubt. Apologies, if that is not what is intended.

---

<div class="post-metadata">

**Author:** ![michaellizhou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaellizhou/32/4143_2.png) [@michaellizhou](https://discuss.elastic.co/u/michaellizhou)\
**Post date:** [June 16, 2015, 7:09pm UTC](https://discuss.elastic.co/t/how-to-use-multiline-to-break-up-messages-delimited-with-hyphen/2378/5 "2015-06-16T19:09:19Z")

</div>

Chaitanya, I figured it out in theory that is exactly what I did. Just some really complex pattern that is generic with most of the log and then negate. So If anyone else is trying to figure this out you can just negate the similar patterns that are not multiline. Thanks for reminding me about this problem almost forgot about it after working it through.

---

<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:37am UTC](https://discuss.elastic.co/t/how-to-use-multiline-to-break-up-messages-delimited-with-hyphen/2378/6 "2017-07-06T05:37:18Z")

</div>


