Configure outputs for standalone Elastic Agents
The outputs section of the elastic-agent.yml file specifies where to send data. You can specify multiple outputs to pair specific inputs with specific outputs.
An output named default is required. Elastic Agent sends data to it from any input that doesn't specify another output with use_output. Elastic Agent monitoring data also goes to the default output, unless you choose a different output in the monitoring settings.
This example configures two outputs: default and monitoring:
outputs:
default:
type: elasticsearch
hosts: ["localhost:9200"]
api_key: "my_api_key"
monitoring:
type: elasticsearch
hosts: ["localhost:9200"]
api_key: "my_monitoring_api_key"
Elastic Agent currently supports these outputs:
Depending on the input, Elastic Agent uses its default processors to add host, cloud, Docker, and Kubernetes metadata to the events it collects. To turn off some or all of these processors only for the data sent to a specific output, add default_processors to that output.
The default_processors setting accepts the same options for every output type:
enabled: Turns all four processors on or off at once. Set tofalseto turn them all off.add_host_metadata,add_cloud_metadata,add_docker_metadata, andadd_kubernetes_metadata: Turn the individual processors on or off. Set a processor tofalseto turn it off. The processors you don't list stay on.
Individual processor settings take precedence over enabled. For example, to keep only cloud metadata, set enabled to false and add_cloud_metadata to true.
An output's default_processors setting can only turn processors off. If you turn off a processor for all outputs in the default processors feature flag, setting it to true for a specific output doesn't turn it back on.
Turning off a processor removes the fields it adds. Check that the dashboards, alerts, and other features you use don't rely on those fields.
An output's default_processors setting also applies to the monitoring data that Elastic Agent sends to that output. To choose which output receives monitoring data, refer to Configure monitoring for standalone Elastic Agents.
In this example, data sent to the default output doesn't include Docker or Kubernetes metadata, and data sent to the monitoring output doesn't include any of the four types of metadata:
outputs:
default:
type: elasticsearch
hosts: ["localhost:9200"]
api_key: "my_api_key"
default_processors:
add_docker_metadata: false
add_kubernetes_metadata: false
monitoring:
type: elasticsearch
hosts: ["localhost:9200"]
api_key: "my_monitoring_api_key"
default_processors:
enabled: false
For Fleet-managed Elastic Agents, add default_processors to the Advanced YAML configuration of the output in Fleet. Refer to the Elasticsearch, Logstash, or Kafka output settings.