Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

$ echo 'my-host my-process[1234]:@cee: {"logsene-app-token":"LOGSENE_APP_TOKEN_GOES_HERE", "hello":"world"}' | nc logsene-receiver-syslog.sematext.com 514

If you have your rsyslog,  syslog-ng or syslogd daemon already set up to send logs to your application, all you need to do is to make your structured messages comply to CEE. For example:

$ logger '@cee: {"logsene-app-token":"LOGSENE_APP_TOKEN_GOES_HERE", "hello":"world"}'

How it works

...

{
"@timestamp":"2012-12-03T11:42:54.644758+01:00",
"host":"my-host",
"severity":"notice",
"facility":"user",
"syslog-tag":"my-process:",
"source":"my-process:",
"logsene-app-token":"LOGSENE_APP_TOKEN_GOES_HERE",
"hello": "world"
}

How do I specify a timestamp, severity and facility via netcat?

...

echo "<10>2013-08-29T13:41:03.152+03:00 my-host my-process:this is a test message" | nc logsene-receiver-syslog.sematext.com 514

What if I don't want the JSON to be parsed?

If you don't want us to parse the JSON string from the log, you can simply choose not to comply with the CEE standard. For example, if you send this:

$ echo 'my-host my-process:{"hello":"world"}'@cee: {"logsene-app-token":"LOGSENE_APP_TOKEN_GOES_HERE", "message":"this is a test message"} | nc logsene-receiver-syslog.sematext.com 514

It will end up as something like this:

{
"@timestamp":"2012-12-03T11:42:54.644758+01:00",
"host":"my-host",
"severity":"notice",
"facility":"user",
"syslog-tag":"my-process:",
"source":"my-process",
"messsage": "{\"hello\":\"world\"}"
}