I'm using Filebeat in a Docker container to forward logs of every container to a Kafka receiver:
filebeat.prospectors:
- type: log
paths:
- '/var/lib/docker/containers/*/*.log'
json.message_key: log
json.keys_under_root: true
multiline.pattern: '^MSG|WNG|ERR'
multiline.negate: true
multiline.match: after
tail_files: true
processors:
- add_docker_metadata: ~
output.kafka:
hosts: ["plogelk01:9092", "plogelk02:9092", "plogelk03:9092"]
codec.format:
string: '%{[beat.hostname]} message=%{[log]}'
topic: 'filebeat_SUBSTENV_logs'
partition.round_robin:
reachable_only: false
required_acks: 1
compression: gzip
max_message_bytes: 1000000
Any idea why I'm not able to see any docker.* attribute looking at Kafka messages?
Peraphs, am I skipping them by my custom codec?