Json configuration for GELF using test VM


I am trying to send a GELF JSON message over TCP to the graylog test VM. I have an TCP Gelf input which works and receives a message and ingests it when this JSON is used.

echo -n -e ‘{ “version”: “1.1”, “host”: “example.org”, “short_message”: “A short message”, “level”: 5, “_some_info”: “foo” }’"\0" | nc -w0 12201

But when this JSON is used in place it is not picked up by the graylog input.

echo -n -e ‘{“Body”:"",“HTTPmethod”:“POST”,“Headers”:{“Accept”:["/"],“Accept-Encoding”:[“gzip, deflate”],“Cache-Control”:[“no-cache”],“Connection”:[“keep-alive”],“Content-Length”:[“0”],“Postman-Token”:[“0ad4e67d-f69a-4f54-a487-a91845922683”],“User-Agent”:[“PostmanRuntime/7.6.0”]},“Protocol”:“HTTP/1.1”,“URL”:"/",“level”:“info”,“logtype”:“request”,“msg”:"",“remoteip”:“”,“time”:“2019-03-31T21:13:25+11:00”, “short_message”:“this is a short message”, “version”:“1.1”, “hostname”: “quarterpipe”}’"\0" | nc -w0 12201

I have checked by stopping the input and running a netcat listener and it is transferred fine, and when the input is running it gets network traffic but no messages. So what is wrong with my JSON between the 2 messages sent? Is there something else i need to do in configuration regarding expected JSON?



If you want to send JSON, use a RAW Input. You can find in your Graylog server.log some information if your GELF message does not follow the standard and is rejected.

1 Like

Thank you. I’ll look into raw input

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.