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

out_cloudwatch_logs: add record_accessor support for log group and st… #834

Merged
merged 1 commit into from
Aug 17, 2022

Conversation

PettitWesley
Copy link
Contributor

…ream name templating

Signed-off-by: Wesley Pettit wppttt@amazon.com

@@ -18,8 +18,10 @@ See [here](https://github.com/fluent/fluent-bit-docs/tree/43c4fe134611da471e706b
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| region | The AWS region. |
| log_group_name | The name of the CloudWatch Log Group that you want log records sent to. |
| log_group_template | Template for Log Group name using Fluent Bit [record_accessor](https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/classic-mode/record-accessor) syntax. If the template translation fails an error is logged and the log_stream_name or log_stream_prefix are used instead. See the tutorial below for an example. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the documentation mention that the field is optional, and that it overrides the log_group_name if present?
Nit: Missing comma after If the template translation fails

| log_stream_name | The name of the CloudWatch Log Stream that you want log records sent to. |
| log_stream_prefix | Prefix for the Log Stream name. The tag is appended to the prefix to construct the full log stream name. Not compatible with the log_stream_name option. |
| log_stream_template | Template for Log Stream name using Fluent Bit [record_accessor](https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/classic-mode/record-accessor) syntax. If the template translation fails an error is logged and the log_stream_name or log_stream_prefix are used instead. See the tutorial below for an example. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above


Here is an example usage, for a common use case- templating log group and stream names based on Kubernetes metadata.

Recall that the kubernetes filter can add metadata if you run Fluent Bit in kubernetes that will look like the following:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: punctuation needed

@patrick-stephens
Copy link
Contributor

@PettitWesley can we get this updated and merged? A user had an issue in Slack that was resolved after finding this in the code so be good to document it.

…ream name templating

Signed-off-by: Wesley Pettit <wppttt@amazon.com>
@PettitWesley
Copy link
Contributor Author

@patrick-stephens thanks for reminding me, had forgotten about this one

@PettitWesley PettitWesley merged commit 16750d0 into fluent:master Aug 17, 2022
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

Successfully merging this pull request may close these issues.

3 participants