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

Graylog output should send non-empty short_message #2045

Closed
aseev-xx opened this issue Nov 14, 2016 · 2 comments · Fixed by #2154
Closed

Graylog output should send non-empty short_message #2045

aseev-xx opened this issue Nov 14, 2016 · 2 comments · Fixed by #2154
Assignees
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@aseev-xx
Copy link

Bug report

Graylog output plugin send empty string in short_message variable. In source code (https://github.com/influxdata/telegraf/blob/master/plugins/outputs/graylog/graylog.go#L216):
m["short_message"] = " "

This leads to error kind:

2016-11-14T18:43:00.203+03:00 DEBUG [DecodingProcessor] Dropping incomplete message RawMessage{id=058d2ca0-aa81-11e6-8b1d-fa163e114f3b, journalOffset=3910, codec=gelf, payloadSize=137, timestamp=2016-11-14T15:43:00.202Z} on input <5829c1620b85885f77706457>. Parsed fields: [{total=0, in=0, name=swap, used_percent=0, _id=058d53b0-aa81-11e6-8b1d-fa163e114f3b, source=<HOSTNAME>, used=0, message=, free=0, timestamp=2016-11-14T15:43:00.000Z, out=0}]

As workaround, i'm recompile telegraf with:
m["short_message"] = "telegraf"
and all issues decided.

Relevant telegraf.conf:

[[inputs.swap]]

[[outputs.graylog]]
   servers = ["127.0.0.1:12201"]

Steps to reproduce:

the easiest way to reproduce error is:

normal work:
bash# echo -e '{"version": "1.1","host":"example.org","short_message":"Short message","full_message":"Full_msg","level":1,"_user_id":9001,"_some_info":"foo","_some_env_var":"bar"}\0' | nc -w 1 -u 127.0.0.1 12201
not work with error dropping incomplete message:
bash# echo -e '{"version": "1.1","host":"example.org","short_message":" ","full_message":"Full_msg","level":1,"_user_id":9001,"_some_info":"foo","_some_env_var":"bar"}\0' | nc -w 1 -u 127.0.0.1 12201

Expected behavior:

Data should be correctly parsed

Actual behavior:

Data is not parsed correctly and discarded

@sparrc
Copy link
Contributor

sparrc commented Nov 14, 2016

what version of graylog & telegraf are you using?

@aseev-xx
Copy link
Author

I tested Graylog v2.1.2 & Telegraf 1.0.1

@sparrc sparrc added bug unexpected problem or unintended behavior and removed Need More Info labels Nov 15, 2016
@sparrc sparrc added this to the 1.2.0 milestone Nov 15, 2016
sparrc added a commit that referenced this issue Dec 13, 2016
njwhite pushed a commit to njwhite/telegraf that referenced this issue Jan 31, 2017
maxunt pushed a commit that referenced this issue Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants