I am using filebeat to read Docker logs and feed them to logstash. I have some logs that are being split into separate events. This happens with stack traces, or just any logs with a new line in them.
Here is my filebeat.yml file.
filebeat.autodiscover:
providers:
- type: docker
templates:
- config:
- type: container
paths:
- "/var/lib/docker/containers/${data.docker.container.id}/*.log"
logging.metrics.enabled: false
output.logstash:
hosts:
- logstash:5044
I have a couple questions about this. First off, if I look in those .log
files, they are in the following format
{"log":"Message is in here\n", "stream":"stderr", "time":"<timestamp here>"}
{"log":"\u0009this line should be added to the previous log\n", "stream":"stderr", "time":"<timestamp here>"}
In the multiline.pattern field, is it looking to match the log part only, or the entire line starting with the {? Basically it comes down to should I use
multiline.pattern: '^{"log":"\t'
or
multiline.pattern: '^\t'
In addition, will this tool even work because i just want to take the log part and append it to the previous log message?