ankit
ankit

Reputation: 1529

Unable to Log Python List Objects as Message in 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.

Upvotes: 0

Views: 602

Answers (1)

akshay naveen
akshay naveen

Reputation: 73

Try using 'graypy'. It lets you post logs to graylog using TCP port 12201 for the input streams creating. It also lets you add additional parameters, that you can tag to a message using adapters. The documentation has examples for adapters.

Upvotes: 1

Related Questions