Created
April 20, 2018 14:17
-
-
Save exekias/e802ef376fdbbd4ba5872b57af4128bf to your computer and use it in GitHub Desktop.
Test Filebeat autodiscover conditions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2.1' | |
services: | |
filebeat: | |
user: root | |
image: docker.elastic.co/beats/filebeat:6.2.4 | |
volumes: | |
- ./filebeat.yml:/usr/share/filebeat/filebeat.yml:ro | |
- /var/lib/docker/containers:/var/lib/docker/containers:ro | |
- /var/run/docker.sock:/var/run/docker.sock | |
command: "filebeat -e -v --strict.perms=false" | |
apache: | |
image: httpd:latest | |
nginx: | |
image: nginx:latest | |
busybox: | |
image: busybox | |
command: "sh -c 'while true; do wget -q -O- apache > /dev/null; wget -q -O- nginx > /dev/null; sleep 5; done'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filebeat.autodiscover: | |
providers: | |
- type: docker | |
templates: | |
- condition.or: | |
- contains.docker.container.name: "apache" | |
- contains.docker.container.name: "nginx" | |
config: | |
- type: docker | |
containers.ids: | |
- ${data.docker.container.id} | |
output.console: | |
pretty: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment