Hello,
I wrote small custom filebeat module for our web app logs parsing,
but unable to catch multiline messages with exceptions,
we are using filebeat at host, app is running in docker containers,
the question is how can i match multiline correctly,
using grok patterns in my module pipeline.json,
or in filebeat.yml?
example lines from log, what i want, is to add line with 'str' object has no attribute 'get'
to previous line
[2018-10-04 10:50:41 +0000] [ERROR] validation_plugin::validation_plugin.py::validate_data():L65:Exception at Validation process:
'str' object has no attribute 'get'
[2018-10-04 10:50:41 +0000] 10.0.1.101 (HTTP/1.1 200) GET / : Retned 34976 bytes in 60 msecs to "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
my config:
filebeat.autodiscover:
providers:
- type: docker
templates:
- condition.or:
- contains.docker.container.name: "backend"
config:
- module: custommodule
backend:
prospector:
type: docker
containers.stream: stderr
multiline.pattern: '^\['
multiline.negate: true
multiline.match: after
containers.ids:
- "${data.docker.container.id}"
error:
prospector:
type: docker
containers.stream: stderr
containers.ids:
- "${data.docker.container.id}"