# MultiLine Pattern

**URL:** <https://discuss.elastic.co/t/multiline-pattern/135358>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [June 11, 2018, 12:13pm UTC](https://discuss.elastic.co/t/multiline-pattern/135358 "2018-06-11T12:13:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![83500bcd6348a4be6df4](https://avatars.discourse-cdn.com/v4/letter/8/ce73a5/32.png) [@83500bcd6348a4be6df4](https://discuss.elastic.co/u/83500bcd6348a4be6df4)\
**Post date:** [June 11, 2018, 12:13pm UTC](https://discuss.elastic.co/t/multiline-pattern/135358/1 "2018-06-11T12:13:37Z")

</div>

How to Write Multiline Patter to Pick the Multiple Lines between =-=-=-=-=-=- as single Message or record, the log i want to parse looks like this

> <https://gist.github.com/harshityadav95/31068ee824ec4854f854dcd2d41f2a02>

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [June 11, 2018, 3:01pm UTC](https://discuss.elastic.co/t/multiline-pattern/135358/2 "2018-06-11T15:01:27Z")

</div>

@83500bcd6348a4be6df4 The best way to tests for a multiline pattern is to use a go playground.

I've tested your original data, you could use the pattern = `=-=-=-=-=-=-=-=-` and set negate option to true.

You can see the code and the result [there](https://play.golang.org/p/VZgj_td6kRj)

---

<div class="post-metadata">

**Author:** ![83500bcd6348a4be6df4](https://avatars.discourse-cdn.com/v4/letter/8/ce73a5/32.png) [@83500bcd6348a4be6df4](https://discuss.elastic.co/u/83500bcd6348a4be6df4)\
**Post date:** [June 13, 2018, 6:32am UTC](https://discuss.elastic.co/t/multiline-pattern/135358/3 "2018-06-13T06:32:26Z")

</div>

Can i do the same in c++ , c# or maybe python ? if so where can i look for its documentation ?

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [June 13, 2018, 2:26pm UTC](https://discuss.elastic.co/t/multiline-pattern/135358/4 "2018-06-13T14:26:54Z")

</div>

Since Filebeat is written in go we don't have a specific example in other languages.  
But the regular expression is using the RE2 syntax and you can see all the details at our doc page at [https://www.elastic.co/guide/en/beats/filebeat/current/regexp-support.html](https://www.elastic.co/guide/en/beats/filebeat/current/regexp-support.html) or the official golang doc at [https://github.com/google/re2/wiki/Syntax](https://github.com/google/re2/wiki/Syntax).

---

<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 11, 2018, 2:26pm UTC](https://discuss.elastic.co/t/multiline-pattern/135358/5 "2018-07-11T14:26:56Z")

</div>

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