filebeat.inputs:
- type: log
paths:
- "/var/lib/docker/containers/*/*.log"
json.keys_under_root: true
json.add_error_key: true
json.message_key: log
processors:
- rename:
fields:
- from: "log"
to: "log.message"
when:
not:
has_fields: ['log.flags']
- add_docker_metadata: ~
fields:
application_name: <%= node.chef_environment %>
log_type: "container_logs"
multiline.pattern: (\d{4})-(\d{2})-(\d{2})
multiline.negate: true
multiline.match: after
Logs:
{"log":"2019-02-04 20:15:25.740 ERROR [reporting,,,] --- [enerContainer-1] c.o.r.s.impl.ReportExportServiceImpl : createNotificationTask:: exportJobStatus: {} attachmentRequestStatus:{}\n","stream":"stdout","time":"2019-02-04T20:15:25.741261208Z"}
{"log":"\u0009... 58 common frames omitted\n","stream":"stdout","time":"2019-02-04T20:15:25.741612224Z"}
{"log":"\n","stream":"stdout","time":"2019-02-04T20:15:25.741615424Z"}
{"log":"2019-02-04 20:15:34.339 INFO [reporting,23452345,234523453245,false] --- [TaskScheduler-1] o.r.a.ReportAggregationPipelineProcessor : Failed to acquire lock for DATASUBJECTS\n","stream":"stdout","time":"2019-02-04T20:15:34.339299536Z"}
The logs are flowing in fine when it not multiline (The fourth line) but for the first three lines there is a just a single event I can see in kibana with log.flags multiline and no log or message field. This config still works with filebeat 6.4.x version but does not work with changes in 6.5.x version of the filebeat.