After some random time, the watcher looses some(?) active containers. In the log you can see that filebeat is still reading correctly from docker logs but then says, it cannot find the container with add_docker_metadata.go:124: DBG Container not found:
(last line of the log).
Also when I check in docker the container is still there and running but logs are not written to ES. Also the registry is updated. I need to restart the filebeat container and it will pickup the current time, which means I have gaps in my logs in ES.
I am running filebeats 6.0.0 in the official beats docker container.
tail_files: true
filebeat.prospectors:
- type: log
close_inactive: 24h
paths:
- '/var/lib/docker/containers/*/*.log'
json.message_key: log
json.keys_under_root: true
processors:
- add_docker_metadata: ~
- decode_json_fields:
fields: ["log"]
target: ""
when:
equals:
docker.container.name: nginx
output.elasticsearch:
hosts: ["elasticsearch:9200"]
2017/12/01 08:47:53.115968 log.go:85: DBG End of file reached: /var/lib/docker/containers/41b27667b48a4b5f274479523bc4c1123af0ef27df667324cf8a15111b16f325/41b27667b48a4b5f274479523bc4c1123af0ef27df667324cf
Dec 01 08:47:53 hyrb dockerd[10369]: 2017/12/01 08:47:53.129626 client.go:282: DBG PublishEvents: 1 events have been published to elasticsearch in 13.731209ms.
Dec 01 08:47:53 hyrb dockerd[10369]: 2017/12/01 08:47:53.129800 logger.go:29: DBG ackloop: receive ack [6176: 0, 1]
Dec 01 08:47:53 hyrb dockerd[10369]: 2017/12/01 08:47:53.129871 logger.go:29: DBG broker ACK events: count=1, start-seq=33097, end-seq=33097
Dec 01 08:47:53 hyrb dockerd[10369]: 2017/12/01 08:47:53.129978 logger.go:18: DBG ackloop: return ack to broker loop:1
Dec 01 08:47:53 hyrb dockerd[10369]: 2017/12/01 08:47:53.130035 logger.go:18: DBG ackloop: done send ack
Dec 01 08:47:53 hyrb dockerd[10369]: 2017/12/01 08:47:53.130134 registrar.go:200: DBG Processing 1 events
Dec 01 08:47:53 hyrb dockerd[10369]: 2017/12/01 08:47:53.130258 registrar.go:195: DBG Registrar states cleaned up. Before: 15, After: 15
Dec 01 08:47:53 hyrb dockerd[10369]: 2017/12/01 08:47:53.130293 registrar.go:228: DBG Write registry file: /usr/share/filebeat/data/registry
Dec 01 08:47:53 hyrb dockerd[10369]: 2017/12/01 08:47:53.169128 registrar.go:253: DBG Registry file updated. 15 states written.
Dec 01 08:47:53 hyrb dockerd[10369]: 2017/12/01 08:47:53.637285 log.go:85: DBG End of file reached: /var/lib/docker/containers/0ce25642d8009f26fe29da0ff5123b5877661e06f435e118854e344abebfaf5f/0ce25642d8009f26fe29da0ff5123b5877661e06f435e11885
Dec 01 08:47:55 hyrb dockerd[10369]: 2017/12/01 08:47:55.116342 log.go:85: DBG End of file reached: /var/lib/docker/containers/41b27667b48a4b5f274479523bc4c1123af0ef27df667324cf8a15111b16f325/41b27667b48a4b5f274479523bc4c1123af0ef27df667324cf
Dec 01 08:47:57 hyrb dockerd[10369]: 2017/12/01 08:47:57.541338 log.go:85: DBG End of file reached: /var/lib/docker/containers/d7fdf40887de244536e24112b8cdb24222f46ef9421e30024aeba85bb813e333/d7fdf40887de244536e24112b8cdb24222f46ef9421e30024a
Dec 01 08:47:59 hyrb dockerd[10369]: 2017/12/01 08:47:59.114992 prospector.go:140: DBG Run prospector
Dec 01 08:47:59 hyrb dockerd[10369]: 2017/12/01 08:47:59.115035 prospector.go:136: DBG Start next scan
Dec 01 08:47:59 hyrb dockerd[10369]: 2017/12/01 08:47:59.116727 add_docker_metadata.go:124: DBG Container not found: 41b27667b48a4b5f274479523bc4c1123af0ef27df667324cf8a15111b16f325