I don't know what else the message contains, so this will be a simple example, but I'd grok this out as:For example we have a service named: ENTERPRISE-DOCSTORENAS-SERVICE
but it will also match another service ENTERPRISE-DOCSTORENAS-SERVICE-TEST
When trying to filter out the ENTERPRISE-DOCSTORENAS-SERVICE messages from the ENTERPRISE-DOCSTORENAS-SERVICE-TEST messages filters both.
Code: Select all
filter {
grok {
match { message => [ "^.*%{WORD:field1}-%{WORD:field2}-%{WORD:field3}(-%{WORD:field4})?.*" ]
}
}
Code: Select all
field1 = ENTERPRISE
field2 = DOCSTORENAS
field3 = SERVICE
and optionally, if present,
field4 = TEST