# Regex multiline pattern with empty line

**URL:** <https://discuss.elastic.co/t/regex-multiline-pattern-with-empty-line/70324>\
**Category:** Beats\
**Created:** [January 1, 2017, 2:13pm UTC](https://discuss.elastic.co/t/regex-multiline-pattern-with-empty-line/70324 "2017-01-01T14:13:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssasporta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ssasporta/32/13695_2.png) [@ssasporta](https://discuss.elastic.co/u/ssasporta)\
**Post date:** [January 1, 2017, 2:13pm UTC](https://discuss.elastic.co/t/regex-multiline-pattern-with-empty-line/70324/1 "2017-01-01T14:13:36Z")

</div>

Looking for regex for the following lines: (Need to exlude the empty line)

```
<<DEBUG>> [Feb 24 14:36:19] [[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'] [CM] [Asmsa1] (MemoPublisherCreateMemoWithSysTxtFromDGProxy.createMemoWithSysTextFromDG) The
input parameters:

<<<memoInfo ( amdocs.mo.internaldatatypes.MemoInfoExt) >>>
[memoId=null]
[memoTypeId=20]
[appId=null]
[appCode=CM]
[entityId=100000066]
[entityTypeId=null]
[entityTypeCode=CUS]
[memoDate=20151005180226]
[memoSysText=null]
[memoManualText=null]
[memoExternalId=null]
[memoUserId=231]
[memoAttributeInfo=3 items]
[memoAttributeValueInfo=[attr1value=null]
[attr2value=null]
[attr3value=null]
[attr4value=null]
[attr5value=null]
[attr6value=null]
[attr7value=null]
[attr8value=null]
[attr9value=null]
[attr10value=null]]

<<DEBUG>> [Feb 24 14:36:19] [[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'] [CM] (CMEnvironment.getAdapterContextKey) Enter

```

Regards,  
Sharon.

---

<div class="post-metadata">

**Author:** ![maddin2016](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maddin2016/32/16599_2.png) [@maddin2016](https://discuss.elastic.co/u/maddin2016)\
**Post date:** [January 1, 2017, 3:54pm UTC](https://discuss.elastic.co/t/regex-multiline-pattern-with-empty-line/70324/2 "2017-01-01T15:54:47Z")

</div>

Hi @ssasporta, this link should help you. Didn't test it. [Filebeat 1.1.0 exclude lines with only CRLF or LF](https://discuss.elastic.co/t/filebeat-1-1-0-exclude-lines-with-only-crlf-or-lf/41587)

---

<div class="post-metadata">

**Author:** ![ssasporta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ssasporta/32/13695_2.png) [@ssasporta](https://discuss.elastic.co/u/ssasporta)\
**Post date:** [January 2, 2017, 7:57am UTC](https://discuss.elastic.co/t/regex-multiline-pattern-with-empty-line/70324/3 "2017-01-02T07:57:24Z")

</div>

I tried all link offers, but It doesn't work for me.

My original pattern is: `var pattern ='^[#\<]'`

Thanks  
Sharon.

---

<div class="post-metadata">

**Author:** ![ssasporta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ssasporta/32/13695_2.png) [@ssasporta](https://discuss.elastic.co/u/ssasporta)\
**Post date:** [January 2, 2017, 8:12am UTC](https://discuss.elastic.co/t/regex-multiline-pattern-with-empty-line/70324/4 "2017-01-02T08:12:31Z")

</div>

Hi, Actually I don't was to use the exclude\_lines option, as it will exclude all the line. I need my regex in my pattern to understand that the spaces are part of the previous line and not a new record in the log.

This is how the result looks like in the playground:

```
false	<<DEBUG>> [Feb 24 14:36:19] [[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'] [CM] [Asmsa1] (MemoPublisherCreateMemoWithSysTxtFromDGProxy.createMemoWithSysTextFromDG) The
true	input parameters:
true	
**false**	<<<memoInfo ( amdocs.mo.internaldatatypes.MemoInfoExt) >>>
true	[memoId=null]
true	[memoTypeId=20]
true	[appId=null]
true	[appCode=CM]
true	[entityId=100000066]

```

I need that the second false will also be true.

Thanks  
Sharon.

---

<div class="post-metadata">

**Author:** ![ssasporta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ssasporta/32/13695_2.png) [@ssasporta](https://discuss.elastic.co/u/ssasporta)\
**Post date:** [January 2, 2017, 8:48am UTC](https://discuss.elastic.co/t/regex-multiline-pattern-with-empty-line/70324/5 "2017-01-02T08:48:57Z")

</div>

I found other way to do it. (Work around)

As all my log entries are starting with the severity, like that: \<\<DEBUG or \<\<ERROR etc....

I use the pattern:

multiline.pattern = '\<\<DEBUG|\<\<ERROR|\<\< INFO|\<\<FATAL|\<\<WARNING'

and it works fine.

Thanks  
Sharon.

---

<div class="post-metadata">

**Author:** ![maddin2016](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maddin2016/32/16599_2.png) [@maddin2016](https://discuss.elastic.co/u/maddin2016)\
**Post date:** [January 3, 2017, 12:18pm UTC](https://discuss.elastic.co/t/regex-multiline-pattern-with-empty-line/70324/6 "2017-01-03T12:18:20Z")

</div>

Hi @ssasporta, i was on my handy and didn't see the whole log. I think your filter is the only right solution if you say that every log starts with \<\<DEBUG or \<\<INFO and every line after belongs to that event . You may then have the opportunity to exclude these empty lines with `exclude_line`if you want.

Best regards,

Martin

---

<div class="post-metadata">

**Author:** ![ssasporta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ssasporta/32/13695_2.png) [@ssasporta](https://discuss.elastic.co/u/ssasporta)\
**Post date:** [January 3, 2017, 1:03pm UTC](https://discuss.elastic.co/t/regex-multiline-pattern-with-empty-line/70324/7 "2017-01-03T13:03:29Z")

</div>

Thanks

---

<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:** [January 22, 2017, 2:14pm UTC](https://discuss.elastic.co/t/regex-multiline-pattern-with-empty-line/70324/8 "2017-01-22T14:14:18Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
