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

short_message field in graylog output hard set to "telegraf" #6683

Closed
dutchman80 opened this issue Nov 20, 2019 · 3 comments · Fixed by #6700
Closed

short_message field in graylog output hard set to "telegraf" #6683

dutchman80 opened this issue Nov 20, 2019 · 3 comments · Fixed by #6700
Labels
feature request Requests for new plugin and for new features to existing plugins
Milestone

Comments

@dutchman80
Copy link

The graylog output plugin is hard setting the required "short_message" field in the GELF message to the string "telegraf". This is happening on line 217 of the output plugin.

It should be setting it to whatever the "short_message" (or "message") field is in the input metric. The way it works now, the actual log messages from the logparser input are not actually passed to Graylog properly.

I don't know 'go' at all or I would have done a pull request with proper error handling.

System info:

telegraf-1.12.5-1

Expected behavior:

Something like...
m["short_message"] = metric.Fields()["short_message"]

Actual behavior:

m["short_message"] = "telegraf"

@danielnelson
Copy link
Contributor

This plugin could definitely use some updates, but we need to be mindful about backwards compatibility. I think it would make sense to add an option to control how the field is set:

[[outputs.graylog]]
  short_message_field = "message"

If the metric doesn't have this field set, or if the option is unset, then we would fall back to the static "telegraf" string. What do you think?

@danielnelson danielnelson added the feature request Requests for new plugin and for new features to existing plugins label Nov 20, 2019
@dutchman80
Copy link
Author

I think that would work great!

@danielnelson
Copy link
Contributor

@dutchman80 Are you able to test out one of these builds: #6700 (comment)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants