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

Cloudwatch logs created with tags #365

Open
oc-stephen-bennett opened this issue Apr 25, 2024 · 5 comments
Open

Cloudwatch logs created with tags #365

oc-stephen-bennett opened this issue Apr 25, 2024 · 5 comments

Comments

@oc-stephen-bennett
Copy link

Hi,

We would like to tag the cloudwatch loggroups that are created with fluentbit. Looking back there is suggestions that you could use 'log_group_tags:' (#51) but this isnt in the docs / doesnt work.

Is there any method to automate tagging for cloudwatch resources from fluentbit?

@boatmisser
Copy link

I believe the field is new_log_group_tags; so assume it only works on first time log group creation and will not tag after the fact!?

@oc-stephen-bennett
Copy link
Author

Hi if i update the OUTPUT values like:

[OUTPUT]
                    Name cloudwatch_logs
                    Match   *
                    region eu-west-2
                    log_group_name /aws/eks/fluentbit-cloudwatch/logs
                    log_group_template /aws/eks/fluentbit-cloudwatch/workload/$kubernetes['namespace_name']
                    log_stream_prefix fluent-bit-
                    log_stream_template $kubernetes['pod_name'].$kubernetes['container_name']
                    auto_create_group On
                   new_log_group_tags domain=test

the docker image errors with:

[2024/04/26 09:19:49] [error] [config] cloudwatch_logs: unknown configuration property 'new_log_group_tags'. The following properties are allowed: region, log_group_name, log_stream_name, log_stream_prefix, log_group_template, log_stream_template, log_key, extra_user_agent, log_format, role_arn, auto_create_group, auto_retry_requests, log_retention_days, endpoint, sts_endpoint, external_id, metric_namespace, metric_dimensions, and profile.
[2024/04/26 09:19:49] [ help] try the command: /fluent-bit/bin/fluent-bit -o cloudwatch_logs -h[2024/04/26 09:19:49] [error] [engine] output initialization failed
[2024/04/26 09:19:50] [ info] [input] pausing tail.0[2024/04/26 09:19:50] [ info] [input] pausing systemd.1

Running from helm chart 0.46.2

@InvisibleMan1306
Copy link

InvisibleMan1306 commented May 21, 2024

I saw this https://github.com/aws/aws-for-fluent-bit/blob/604204ecb9efdb06440cfea08d2c3e83adefc983/troubleshooting/debugging.md?plain=1#L1737-L1748

Looks like cloudwatch_logs is defined here https://github.com/fluent/fluent-bit/tree/master/plugins/out_cloudwatch_logs but does not support new_log_group_tags yet. This is the only issue I see referencing this parity gap fluent/fluent-bit#7376.

@aibazhang
Copy link

aibazhang commented Jun 10, 2024

new_log_group_tags is only supported with Name cloudwatch (not cloudwatch_logs).
#317 (comment)

So just change your plugin name to cloudwatch your issue would be solved, but be careful that record_accessor syntax has been changed.

https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit/blob/mainline/README.md?plain=1#L150-L161

@irizzant
Copy link

Ok but since the new cloudwatch_logs plugin seems to be a replacement for the old one why not adding this feature to cloudwatch_logs too?

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

5 participants