GELF

The GuinsooLab Extended Log Format (GELF) is a log format that avoids the shortcomings of classic plain syslog:

  • Limited to length of 1024 bytes. Inadequate space for payloads like backtraces.

  • No data types in structured syslog. Numbers and strings are indistinguishable.

  • The RFCs are strict enough, but there are so many syslog dialects out there that you cannot possibly parse all of them.

  • No compression.

Sending GELF Messages Via UDP Using Netcat

Sending an example message to a GELF UDP input (running on the host leona.example.com on port 12201):

echo -n '{ "version": "1.1", "host": "example.org", "short_message": "A short message", "level": 5, "_some_info": "foo" }' | nc -w0 -u leona.example.com 12201

Sending GELF Messages Via TCP Using Netcat

Sending an example message to a GELF TCP input (running on the host leona.example.com on port 12201):

echo -n '{ "version": "1.1", "host": "example.org", "short_message": "A short message", "level": 5, "_some_info": "foo" }' | nc -w0 -u leona.example.com 12201

Sending GELF Messages Via Using Curl

Sending an example message to a GELF input (running on the host leona.example.com on port 12201):

curl -X POST -H 'Content-Type: application/json' -d '{ "version": "1.1", "host": "example.org", "short_message": "A short message", "level": 5, "_some_info": "foo" }' 'leona.example.com:12201/gelf'

Last updated