Unable to Log Python List Objects Using Graylog

I am trying to send Python List as Log Message to Graylog. The approach that i am using is “Sending GELF messages via HTTP using curl” mentioned in http://docs.graylog.org/en/2.4/pages/gelf.html

But when i send data as below:

curl -X POST -H 'Content-Type: application/json' -d '{"log_type":"debug", "short_message": "[1,4,5,2]", "block_id":"TEST_LOGGING"}' 'http://<host>:12201/gelf'

it works perfectly fine.

Where as on sending message as below Logs nothing.

curl -X POST -H 'Content-Type: application/json' -d '{"log_type":"debug", "short_message": [1,4,5,2], "block_id":"TEST_LOGGING"}' 'http://<host>:12201/gelf'

I am unable to figure out the issue.

you message does not contain all needed information to be a valid GELF message …

@jan Thanks for your reply.
But why the First one with “[1,4,5,2]” as short_message gets logged. That request also doesn’t contain all the required fields.

what does the Graylog server.log tell you when you ingest the first and the last message?

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