fluent-plugins-nursery / fluent-plugin-cloudwatch-logs

CloudWatch Logs Plugin for Fluentd
MIT License
201 stars 141 forks source link

Unable to tag log groups with dynamic values #257

Closed kilitr closed 5 months ago

kilitr commented 6 months ago

Problem

I want to be able to set specific tags to the log groups created through this plugin based on annotations and labels but at least based on environment variables of the fluentd pod / container.

Steps to replicate

These are different variations i have tried achieving this:

log_group_aws_tags '{"Key": #{ENV["DEFAULT_KEY"]} }' log_group_aws_tags %({"Key": "#{ENV['DEFAULT_KEY']}"}) log_group_aws_tags "{'Key': '${ENV['DEFAULT_KEY}']'}" log_group_aws_tags "{'Key': '${ENV[\'DEFAULT_KEY}\']'}" log_group_aws_tags "{'Key': '${ENV.DEFAULT_KEY}'}" log_group_aws_tags "{'Key': '${ENV['DEFAULT_KEY']}'}"

I made sure, the following works - and it did. log_group_aws_tags "{'Key': 'Value'}"

Expected Behavior or What you need to ask

I wanted to see the new log group created with the value of the environment variable.

Using Fluentd and CloudWatchLogs plugin versions