Hi,
I am trying to match following logs for icinga2 using grok filter:
[2021-03-04 17:03:27 +0100] warning/GraphiteWriter: Ignoring invalid perfdata for checkable 'host!service' and command 'by_ssh' with value: /foo/bar=4242MiB;9203;9714;0;10226
Context:
(0) Processing check result for 'host!service'
I am trying to use following grok expression:
%{TIMESTAMP_ISO8601:timestamp}] %{WORD:log_level}/%{WORD:component}: %{GREEDYDATA:message}
, which fails because of the "wrong" timestamp format.
As soon as I remove +0100
from the timestamp the filter works (except of the broken multilines).
[2021-03-04 17:03:27] warning/GraphiteWriter: Ignoring invalid perfdata for checkable 'host!service' and command 'by_ssh' with value: /foo/bar=4242MiB;9203;9714;0;10226
Context:
(0) Processing check result for 'host!service'
becomes:
{
"component": "GraphiteWriter",
"log_level": "warning",
"message": "Ignoring invalid perfdata for checkable 'host!service' and command 'by_ssh' with value: /foo/bar=4242MiB;9203;9714;0;10226\r",
"timestamp": "2021-03-04 17:03:27"
}
Is there any other timestamp filter I can use to parse the date correctly?
Thanks