Regex multiline pattern with empty line


(Sharon Sasporta) #1

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.


(Maddin2016) #2

Hi @ssasporta, this link should help you. Didn't test it. Filebeat 1.1.0 exclude lines with only CRLF or LF


(Sharon Sasporta) #3

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

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

Thanks
Sharon.


(Sharon Sasporta) #4

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.


(Sharon Sasporta) #5

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.


(Maddin2016) #6

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_lineif you want.

Best regards,

Martin


(Sharon Sasporta) #7

Thanks


(system) #8

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