Tip
|
Inputs that collect logs and metrics use this processor by default, so you do not need to configure it explicitly. |
The add_docker_metadata
processor annotates each event with relevant metadata
from Docker containers. At startup the processor detects a Docker environment
and caches the metadata.
For events to be annotated with Docker metadata, the configuration must be valid, and the processor must be able to reach the Docker API.
Each event is annotated with:
-
Container ID
-
Name
-
Image
-
Labels
Note
|
When running {agent} in a container, you need to provide access to Docker’s unix
socket in order for the
To avoid privilege issues, you may also need to add If the Docker daemon is restarted, the mounted socket will become invalid, and metadata will stop working. When this happens, you can do one of the following:
|
- add_docker_metadata:
host: "unix:///var/run/docker.sock"
#match_fields: ["system.process.cgroup.id"]
#match_pids: ["process.pid", "process.parent.pid"]
#match_source: true
#match_source_index: 4
#match_short_id: true
#cleanup_timeout: 60
#labels.dedot: false
# To connect to Docker over TLS you must specify a client and CA certificate.
#ssl:
# certificate_authority: "/etc/pki/root/ca.pem"
# certificate: "/etc/pki/client/cert.pem"
# key: "/etc/pki/client/cert.key"
Name | Required | Default | Description |
---|---|---|---|
|
No |
|
Docker socket (UNIX or TCP socket). |
|
No |
SSL configuration to use when connecting to the Docker socket. For a list of available settings, refer to [elastic-agent-ssl-configuration], specifically the settings under [common-ssl-options] and [client-ssl-options]. |
|
|
No |
List of fields to match a container ID. At least one of the fields most hold a container ID to get the event enriched. |
|
|
No |
|
List of fields that contain process IDs. If the process is running in Docker, the event will be enriched. |
|
No |
|
Whether to match the container ID from a log path present in the |
|
No |
|
Whether to match the container short ID from a log path present in the |
|
No |
|
Index in the source path split by a forward slash ( |
|
No |
|
Time of inactivity before container metadata is cleaned up and forgotten. |
|
No |
|
Whether to replace dots ( |