Configure feature flags for standalone Elastic Agents
The agent.features section of the elastic-agent.yml file contains settings that change the default behavior of Elastic Agent. These settings might include experimental features, changes to behaviors within Elastic Agent or its components, or settings that could cause a breaking change. For example, a setting that changes information included in events might be inconsistent with the naming pattern expected in your configured Elastic Agent output.
Most of these settings are turned off by default. To change a setting, set its enabled flag. For example, to turn on a setting that's off by default, set enabled to true:
agent.features:
mysetting:
enabled: true
You can specify the following settings in the agent.features section of the elastic-agent.yml file.
- Fully qualified domain name (FQDN)
-
When enabled, information provided about the current host through the host.name key, in events produced by Elastic Agent, is in FQDN format (
somehost.example.comrather thansomehost). This helps you to distinguish between hosts on different domains that have similar names. Withfqdnenabled, the fully qualified hostname allows each host to be more easily identified when viewed in Kibana.NoteFQDN reporting is not currently supported in APM.
For FQDN reporting to work as expected, the hostname of the current host must either:
- Have a CNAME entry defined in DNS.
- Have one of its corresponding IP addresses respond successfully to a reverse DNS lookup.
If neither prerequisite is satisfied,
host.namecontinues to report the hostname of the current host as if the FQDN feature flag were not enabled.To enable fully qualified domain names, set
enabled: truefor thefqdnsetting:agent.features: fqdn: enabled: true - Encrypted config
-
When enabled, Elastic Agent encrypts the contents of
elastic-agent.ymland stores them infleet.enc. It then replaces the contents ofelastic-agent.ymlwith only theencrypted_configsetting, to show that Elastic Agent uses the encrypted configuration.NoteFleet-managed Elastic Agents ignore this flag as they always encrypt storage.
To reload the config, replace the
elastic-agent.ymlfile and restart the Elastic Agent.To enable encrypted config for a standalone Elastic Agent, set
enabled: truefor theencrypted_configsetting:agent.features: encrypted_config: enabled: trueNoteIf you turn off encryption, delete the
fleet.encfile manually. - Default processors
-
Depending on the input, Elastic Agent uses the
add_host_metadata,add_cloud_metadata,add_docker_metadata, andadd_kubernetes_metadatadefault processors to add host, cloud, Docker, and Kubernetes metadata to the events it collects. You can turn off these processors when you don't need the metadata they add, for example to reduce the size of your events. Turning them off removes the fields they add, so check that the dashboards, alerts, and other features you use don't rely on those fields.Depending on your version, the default processor settings apply to the following:
-
All data that Elastic Agent collects -
All data that Elastic Agent collects except data from inputs that use variables from dynamic providers, such as ${kubernetes.*}or${docker.*} -
Only metrics and Elastic Agent monitoring data, except metrics from inputs that use variables from dynamic providers
To turn off all four processors, set
enabledtofalsefor thedefault_processorssetting:agent.features: default_processors: enabled: falseYou can also turn off individual processors for all outputs, or turn off processors only for the data sent to a specific output. -
To turn off individual default processors, set them to false in the default_processors setting. The processors you don't list stay on:
agent.features:
default_processors:
add_docker_metadata: false
add_kubernetes_metadata: false
Individual processor settings take precedence over enabled. For example, this configuration turns off every default processor except add_cloud_metadata:
agent.features:
default_processors:
enabled: false
add_cloud_metadata: true
To turn off processors only for the data sent to a specific output, refer to Turn off default processors for an output.