39 lines
1.4 KiB
Text
39 lines
1.4 KiB
Text
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}"
|
|
-------------------------------------------------------------------------------------
|