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

ParameterDescriptionExample
${pod_name}Pod nameunderstood-butterfly-logging-demo-7dcdcfdcd7-h7p9n
${container_name}Container name inside the Podlogging-demo
${namespace_name}Namespace namedefault
${pod_id}Kubernetes UUID for Pod1f50d309-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 ondocker-desktop
${docker_id}Docker UUID of the container3a38148aa37aa3…

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>