Tag Normaliser
Fluentd Plugin to re-tag based on log metadata
Overview
More info at https://github.com/kube-logging/fluent-plugin-tag-normaliser
Available kubernetes metadata
Parameter | Description | Example |
---|---|---|
${pod_name} | Pod name | understood-butterfly-logging-demo-7dcdcfdcd7-h7p9n |
${container_name} | Container name inside the Pod | logging-demo |
${namespace_name} | Namespace name | default |
${pod_id} | Kubernetes UUID for Pod | 1f50d309-45a6-11e9-b795-025000000001 |
${labels} | Kubernetes Pod labels. This is a nested map. You can access nested attributes via . | {“app”:“logging-demo”, “pod-template-hash”:“7dcdcfdcd7” } |
${host} | Node hostname the Pod runs on | docker-desktop |
${docker_id} | Docker UUID of the container | 3a38148aa37aa3… |
Configuration
Tag Normaliser parameters
format (string, optional)
Re-Tag log messages info at github
Default: ${namespace_name}.${pod_name}.${container_name}
match_tag (string, optional)
Tag used in match directive.
Default: kubernetes.**
Example Parser
filter configurations
apiVersion: logging.banzaicloud.io/v1beta1
kind: Flow
metadata:
name: demo-flow
spec:
filters:
- tag_normaliser:
format: cluster1.${namespace_name}.${pod_name}.${labels.app}
selectors: {}
localOutputRefs:
- demo-output
Fluentd Config Result
<match kubernetes.**>
@type tag_normaliser
@id test_tag_normaliser
format cluster1.${namespace_name}.${pod_name}.${labels.app}
</match>
Last modified July 24, 2023: Merge pull request #167 from kube-logging/link-fixes-230714 (1dda279)