ECS Metadata
The ECS Filter Enriches logs with AWS Elastic Container Service Metadata. The plugin can enrich logs with task, cluster and container metadata. The plugin uses the ECS Agent introspection API to obtain metadata. This filter only works with the ECS EC2 launch type. The filter only works when Fluent Bit is running on an ECS EC2 Container Instance and has access to the ECS Agent introspection API. The filter is not supported on ECS Fargate. To obtain metadata on ECS Fargate, use the built-in FireLens metadata or the AWS for Fluent Bit init project.
Configuration Parameters
The plugin supports the following configuration parameters:
Supported Templating Variables for the ADD option
The following template variables can be used for values with the Add
option. See the tutorial below for examples.
Configuration File
Example 1: Attach Task ID and cluster name to container logs
The output log should be similar to:
Example 2: Attach customized resource name to container logs
The output log would be similar to:
Notice that the template variables in the value for the resource
key are separated by dot characters, only dots and commas (.
and ,
) can come after a template variable. For more information, please check the Record accessor limitation's section.
Example 3: Attach cluster metadata to non-container logs
This examples shows a use case for the Cluster_Metadata_Only
option- attaching cluster metadata to ECS Agent logs.
Last updated