Hi there,
After reading and watching this information:
https://www.elastic.co/guide/en/beats/filebeat/6.3/configuration-autodiscover.html
https://www.elastic.co/webinars/elasticsearch-log-collection-with-kubernetes-docker-and-containers
I'm still not 100% certain that I have the right filebeat.yml for my use case. I have 7 "static" docker containers and a few that start and stop. I'm trying to monitor all the logs (and performance metrics) from these containers automatically using filebeat "autodiscover". One of my containers is the official Elasticsearch docker container, so if I can enhance anything by using the "elasticsearch" module, that would be cool.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
223b4e9e9203 docker.elastic.co/beats/filebeat:6.3.0 "/usr/local/bin/dock…" About an hour ago Up 6 minutes filebeat
ac124ea897ec traceloggercisco/tacassist:latest "/bin/sh -c 'cron &&…" 12 days ago Up 25 hours 80/tcp, 85/tcp, 0.0.0.0:85->443/tcp tacassist
02f08fe30ed9 traceloggercisco/maintenance:latest "crond -f" 12 days ago Up 25 hours maintenance
3ec9b5d75b56 traceloggercisco/idm:latest "python3 ./main.py" 12 days ago Up 25 hours 0.0.0.0:8506->80/tcp idm
2f9c2b74197c traceloggercisco/logstorage:latest "python3 ./LogStorag…" 12 days ago Up 25 hours logstorage
bd4b65647675 traceloggercisco/webapp:latest "/entrypoint.sh /usr…" 12 days ago Up 25 hours 80/tcp, 0.0.0.0:8443->443/tcp webapp
1db10faa880b elasticsearch:tracelogger "/bin/bash bin/es-do…" 3 weeks ago Up 25 hours 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp elasticsearch
my filebeat.yml is:
filebeat.prospectors:
- type: docker
containers.ids:
- '*'
#=========================== Filebeat autodiscover ==============================
filebeat.autodiscover:
# Autodiscover docker containers and parse logs
providers:
- type: docker
templates:
- condition.contains:
docker.container.image: elasticsearch
config:
- module: elasticsearch
log:
input:
type: docker
containers.ids:
- "${data.docker.container.id}"
processors:
- add_docker_metadata:
Does this look alright? Do I have everything I need? I am seeing logs coming in, but not from all the containers. I'm assuming that filebeat should find all the containers and retrieve their logs even if filebeat has started after the other containers?