- Fleet and Elastic Agent Guide: other versions:
- Fleet and Elastic Agent overview
- Beats and Elastic Agent capabilities
- Quick starts
- Migrate from Beats to Elastic Agent
- Set up Fleet Server
- Install Elastic Agents
- Install Fleet-managed Elastic Agents
- Install standalone Elastic Agents (advanced users)
- Install Elastic Agents in a containerized environment
- Installation layout
- Air-gapped environments
- Use a proxy server with Elastic Agent and Fleet
- Uninstall Elastic Agents from edge hosts
- Start and stop Elastic Agents on edge hosts
- Elastic Agent configuration encryption
- Secure connections
- Manage Elastic Agents in Fleet
- Manage integrations
- Configure standalone Elastic Agents
- Command reference
- Troubleshoot
- Release notes
Docker Provider
editDocker Provider
editProvides inventory information from Docker. The available keys are:
Key | Type | Description |
---|---|---|
|
|
ID of the container |
|
|
Arg path of container |
|
|
Name of the container |
|
|
Image of the container |
|
|
Labels of the container |
|
|
Ports of the container |
|
|
Object of paths for the container |
|
|
Log path of the container |
For example, the Docker provider provides the following inventory:
[ { "id": "1", "mapping:": {"id": "1", "paths": {"log": "/var/log/containers/1.log"}}, "processors": {"add_fields": {"container.name": "my-container"}} }, { "id": "2", "mapping": {"id": "2", "paths": {"log": "/var/log/containers/2.log"}}, "processors": {"add_fields": {"container.name": "other-container"}} } ]
Elastic Agent automatically prefixes the result with docker
:
--- [ {"docker": {"id": "1", "paths": {"log": "/var/log/containers/1.log"}}}, {"docker": {"id": "2", "paths": {"log": "/var/log/containers/2.log"}}, ] ---
To set the log path dynamically in the configuration, use a variable in the Elastic Agent policy to return path information from the provider:
inputs: - type: logfile path: "${docker.paths.log}"
The policy generated by this configuration looks like:
inputs: - type: logfile path: "/var/log/containers/1.log" processors: - add_fields: container.name: my-container - type: logfile path: "/var/log/containers/2.log" processors: - add_fields: container.name: other-container