youtubebeat/vendor/github.com/elastic/beats/filebeat/docs/autodiscover-docker-config.asciidoc

40 lines
1.4 KiB
Text
Raw Normal View History

2018-11-18 11:08:38 +01:00
Filebeat supports templates for inputs and modules.
["source","yaml",subs="attributes"]
-------------------------------------------------------------------------------------
filebeat.autodiscover:
providers:
- type: docker
templates:
- condition:
contains:
docker.container.image: redis
config:
- type: docker
containers.ids:
- "${data.docker.container.id}"
exclude_lines: ["^\\s+[\\-`('.|_]"] # drop asciiart lines
-------------------------------------------------------------------------------------
This configuration launches a `docker` logs input for all containers running an image with `redis` in the name.
If you are using modules, you can override the default input and use the docker input instead.
["source","yaml",subs="attributes"]
-------------------------------------------------------------------------------------
filebeat.autodiscover:
providers:
- type: docker
templates:
- condition:
contains:
docker.container.image: redis
config:
- module: redis
log:
input:
type: docker
containers.ids:
- "${data.docker.container.id}"
-------------------------------------------------------------------------------------