Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to tag log groups with dynamic values #257

Closed
kilitr opened this issue Jan 30, 2024 · 0 comments
Closed

Unable to tag log groups with dynamic values #257

kilitr opened this issue Jan 30, 2024 · 0 comments

Comments

@kilitr
Copy link

kilitr commented Jan 30, 2024

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

  • amazonlinux2
  • Kubernetes (EKS 1.24)
  • fluentd 1.16.3
  • Dependent gem versions
    • paste boot log of fluentd or td-agent
    • paste result of fluent-gem list, td-agent-gem list or your Gemfile.lock
    •   *** LOCAL GEMS ***
        
        abbrev (default: 0.1.0)
        addressable (2.8.6)
        async (1.31.0)
        async-http (0.60.2)
        async-io (1.37.0)
        async-pool (0.4.0)
        aws-eventstream (1.3.0)
        aws-partitions (1.864.0)
        aws-sdk-cloudwatchlogs (1.75.0)
        aws-sdk-core (3.190.0)
        aws-sigv4 (1.8.0)
        base64 (default: 0.1.1)
        benchmark (default: 0.2.0)
        bigdecimal (3.1.4, default: 3.1.1, 1.4.4)
        bundler (2.4.22)
        cgi (default: 0.3.6)
        concurrent-ruby (1.2.2)
        console (1.23.2)
        cool.io (1.8.0)
        csv (default: 3.2.5)
        date (default: 3.2.2)
        delegate (default: 0.2.0)
        did_you_mean (default: 1.6.1)
        digest (default: 3.1.0)
        domain_name (0.6.20231109)
        drb (default: 2.1.0)
        english (default: 0.7.1)
        erb (default: 2.2.3)
        error_highlight (default: 0.3.0)
        etc (default: 1.3.0)
        fcntl (default: 1.0.1)
        ffi (1.16.3)
        ffi-compiler (1.0.1)
        fiber-annotation (0.2.0)
        fiber-local (1.0.0)
        fiddle (default: 1.1.0)
        fileutils (default: 1.6.0)
        find (default: 0.1.1)
        fluent-plugin-cloudwatch-logs (0.14.3)
        fluent-plugin-concat (2.5.0)
        fluent-plugin-kubernetes_metadata_filter (3.4.0)
        fluent-plugin-prometheus (2.1.0)
        fluentd (1.16.3)
        forwardable (default: 1.3.2)
        getoptlong (default: 0.1.1)
        http (5.1.1)
        http-accept (1.7.0)
        http-cookie (1.0.5)
        http-form_data (2.3.0)
        http_parser.rb (0.8.0)
        io-console (default: 0.5.11)
        io-nonblock (default: 0.1.0)
        io-wait (default: 0.2.1)
        ipaddr (default: 1.2.4)
        irb (default: 1.4.1)
        jmespath (1.6.2)
        json (2.6.3, default: 2.6.1)
        jsonpath (1.1.3)
        kubeclient (4.11.0)
        llhttp-ffi (0.4.0)
        logger (default: 1.5.0)
        lru_redux (1.1.0)
        mime-types (3.5.1)
        mime-types-data (3.2023.1205)
        msgpack (1.7.2)
        multi_json (1.15.0)
        mutex_m (default: 0.1.1)
        net-http (default: 0.3.0)
        net-protocol (default: 0.1.2)
        netrc (0.11.0)
        nio4r (2.5.9)
        nkf (default: 0.1.1)
        observer (default: 0.1.1)
        oj (3.16.2, 3.16.1)
        open-uri (default: 0.2.0)
        open3 (default: 0.1.1)
        openssl (default: 3.0.1)
        optparse (default: 0.2.0)
        ostruct (default: 0.5.2)
        pathname (default: 0.2.0)
        pp (default: 0.3.0)
        prettyprint (default: 0.1.1)
        prometheus-client (4.2.2)
        protocol-hpack (1.4.2)
        protocol-http (0.24.7)
        protocol-http1 (0.15.1)
        protocol-http2 (0.15.1)
        pstore (default: 0.1.1)
        psych (default: 4.0.4)
        public_suffix (5.0.4)
        racc (default: 1.6.0)
        rake (13.1.0)
        readline (default: 0.0.3)
        readline-ext (default: 0.1.4)
        recursive-open-struct (1.1.3)
        reline (default: 0.3.1)
        resolv (default: 0.2.1)
        resolv-replace (default: 0.1.0)
        rest-client (2.1.0)
        rexml (3.2.6)
        rinda (default: 0.1.1)
        ruby2_keywords (default: 0.0.5)
        securerandom (default: 0.2.0)
        serverengine (2.3.2)
        set (default: 1.0.2)
        shellwords (default: 0.1.0)
        sigdump (0.2.5)
        singleton (default: 0.1.1)
        stringio (default: 3.0.1)
        strptime (0.2.5)
        strscan (default: 3.0.1)
        syslog (default: 0.1.0)
        tempfile (default: 0.1.2)
        time (default: 0.2.2)
        timeout (default: 0.2.0)
        timers (4.3.5)
        tmpdir (default: 0.1.2)
        traces (0.11.1)
        tsort (default: 0.1.0)
        tzinfo (2.0.6)
        tzinfo-data (1.2023.3)
        un (default: 0.2.0)
        uri (0.12.2, default: 0.12.1)
        weakref (default: 0.1.1)
        webrick (1.8.1, 1.7.0)
        yajl-ruby (1.4.3)
        yaml (default: 0.2.0)
        zlib (default: 2.1.1)````
      
@kilitr kilitr closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant