Eventlog entries over multiple lines
For example the InfluxDB "authorization failed" errors are written to the log file with a leading line break:
[2018-04-11 14:34:15 +0000] critical/InfluxdbWriter: InfluxDB error message:
authorization failed
There are other events, which also generate multi-line entries, like this one:
[2018-04-11 14:44:32 +0000] critical/ApiListener: Client TLS handshake failed (from [******]:***)
Context:
(0) Handling new API client connection
This makes the log hard to parse with e.g. logstash, as the subsequent line doesn't match any pattern. If there was a list of all possible multi line events this could be compensated by configuring logstash to merge the lines, but as with InfluxDB I didn't expect this event to generate a second line and logstash couldn't handle this event properly.
In my oppinion it would be great if the main log was restricted to one line per log entry. What do you think or how would you handle this? I'm open to other ideas.
We won't change the logging format, that put first. Have you seen the grok pattern for logstash? This should be able to handle such messages.
https://github.com/Icinga/logstash-grok-pattern
I haven't seen that and this seems to be exactly what I'm looking for. Thank you!
In case anyone is searching for this: I've since resolved the multiline messages within filebeat:
- input_type: log
paths:
- /var/log/icinga2/icinga2.log
multiline:
pattern: '^\['
negate: true
match: 'after'