Skip to content

Graylog output should send non-empty short_message #2045

Closed
@aseev-xx

Description

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

Metadata

Assignees

Labels

bugunexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions