This is purely a sharing thread that I hope I can help the beginner like me when they need to figure how to make Multiline works in Ingest Node, for Glassfish logs.
PUT _ingest/pipeline/test
{
"description": "test",
"on_failure": [
{
"set": {
"field": "error",
"value": "{{ _ingest.on_failure_message }}"
}
}
],
"processors": [
{
"grok": {
"field": "message",
"patterns": [
"\\[%{TIMESTAMP_ISO8601:timestamp}\\] \\[%{DATA:server_version}\\] \\[%{LOGLEVEL:loglevel}\\] \\[%{DATA:message_id}\\] \\[%{DATA:class}\\] \\[%{DATA:thread}\\] \\[timeMillis: %{DATA:timemillis}\\] \\[%{DATA:levelvalue}\\] \\[\\[\\n\\s*%{GREEDYMULTILINE:message_detail}\\]\\]$"
],
"pattern_definitions" : {
"GREEDYMULTILINE" : "(.|\n)*"
},
"ignore_missing": true
}
}
]
}
I am no way an experience grok master here, so suggestion is welcome if there is room for improvement for above grok expression
Cheers!