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

feat(logging): Allow overriding message key for structured logging #16242

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

alexgokhale
Copy link
Contributor

Summary

This PR adds a config option which controls the message key used for structured logs, which currently defaults to the slog.MessageKey value of "msg".

This is particularly useful for changing the key from msg to message, to allow automatic log parsing into certain log processing pipelines (without having to use another tool like fluentbit).

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #16241

This adds a config option which controls the message key used for
structured logs, which currently defaults to the `slog.MessageKey` value
of "msg".
@telegraf-tiger
Copy link
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Nov 28, 2024
@alexgokhale
Copy link
Contributor Author

!signed-cla

@srebhan
Copy link
Member

srebhan commented Dec 2, 2024

See my comment in the issue...

@srebhan srebhan self-assigned this Dec 2, 2024
@srebhan srebhan changed the title feat(slog): Allow overriding the log message key feat(logging): Allow overriding message key for structured logging Dec 4, 2024
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks @alexgokhale!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Dec 4, 2024
@srebhan srebhan assigned DStrand1 and unassigned srebhan Dec 4, 2024
@DStrand1 DStrand1 merged commit 304ab2e into influxdata:master Dec 5, 2024
29 checks passed
@github-actions github-actions bot added this to the v1.33.0 milestone Dec 5, 2024
justinwwhuang pushed a commit to justinwwhuang/telegraf_fork that referenced this pull request Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow configuration of the message key in structured logs
3 participants