Description
Is your feature request related to a problem? Please describe.
I'm using logging operator with tag_normalizer and trying to route logs to different idexes with https://github.com/uken/fluent-plugin-elasticsearch#dynamic-configuration. Somehow I'm not able to use ${kubernetes.labels.app-kubernetes-io/name}
as a placeholder for index name pattern but ${tag} works, so I've decided to try to adjust tag itself however same problem here - I'm not able to use
${labels.app-kubernetes-io/name}` as a value in tag - it is always empty (unknown)
Describe the solution you'd like to see
Maybe I need to use some special syntax I'm not aware about
Describe alternatives you've considered
Tried to set index name with placeholders but it does not work either
Additional context
When I'm trying to run tests from this repo but with another set of labels - it works, but it does not work in the real life fluentd :(
test "lables_test" do
config = %[
format cluster.${namespace_name}.${labels.app.kubernetes.io/name}
]
record = {
"log" => "Example",
"kubernetes" => {
"pod_name" => "understood-butterfly-nginx-logging-demo-7dcdcfdcd7-h7p9n",
"namespace_name" => "default",
"labels" => {
"app" => {
"kubernetes" => {
"io/name" => "traefik",
"io/managed-by" => "helm"
}
}
}
}
}
d = create_driver(config)
d.run(default_tag: 'test') do
d.feed("tag1", event_time, record.dup)
d.feed("tag1", event_time, record.dup)
end
events = d.events
puts events
end
result:
{"log"=>"Example", "kubernetes"=>{"pod_name"=>"understood-butterfly-nginx-logging-demo-7dcdcfdcd7-h7p9n", "namespace_name"=>"default", "labels"=>{"app"=>{"kubernetes"=>{"io/name"=>"traefik", "io/managed-by"=>"helm"}}}}}
cluster.default.traefik