question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong format of the syslog messages

See original GitHub issue

Your syslog message looks at the moment like this

<133>{"time": "2022-01-01 19:35:25+0100", "hostname": "checkmk", "path": "/usr/bin/pycharm/pycharm-community-2021.1.3/lib/log4j.jar", "entry": "", "product": "Log4j 1", "version": "1.2.17.2", "cve": "CVE-2021-4104", "status": "MITIGATED", "fixed": false}

Acording to RFC5424 the header (the stuff before the STRUCTURED-DATA/MESSAGE) should look like this

PRI VERSION SP TIMESTAMP SP HOSTNAME SP APP-NAME SP PROCID SP MSGID

followed by SP STRUCTURED-DATA [SP MSG] (structured data must always be encoded in UTF-8). If the MESSAGE is UTF-8 encoded it must start with the BOM (BOM = %xEF.BB.BF).

You are using only the PRI (Facility/Severity) field (<133>) and the Message. This causes problems with some syslog implementations as the expect the message to be like in the RFC.

If you want to skip optional fileds you can use the NILVALUE (-).

So your syslog message should look at least like this

<133> 1 - - - - - - {your message}

It would be nice to have the TIMESTAMP, HOSTNAME and APP-NAME populated like this (skipped PROCID, MSGID and STRUCTURED-DATA)

<133> 1 2022-01-01T23:20:50.52Z CHECKMK LOG4J-SCANNER - - - {your message}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
thl-cmkcommented, Jan 2, 2022

@xeraph I think this can be cosed 😃 (your typo is also gone)

1reaction
thl-cmkcommented, Jan 2, 2022

works again. Perfect!

Read more comments on GitHub >

github_iconTop Results From Across the Web

K26457459: Syslog messages are sent with incorrect source IP
The issue is due to ID 747676. On versions where ID 740589 is fixed, an improper configuration will prevent syslog-ng from even starting...
Read more >
Common syslog-ng error messages and their solutions - Blog
In this post, we would like to explain a few common syslog-ng error and warning messages, what they mean, and how to solve...
Read more >
How does the syslog message format look like? - Techzone
This article provides examples which illustrate how the log messages are sent to the syslog server, how they are formated and which columns ......
Read more >
Correct format of syslog messages to be transmitted over UDP ...
The format I am using looks like this: msgLen = sprintf_s(syslogMessage, 1024, "<%d>%d %s %s [%s] : " ...
Read more >
Technical Note: Invalid Syslog Message Format from...
It is possible if these invalid syslog messages are received at a high enough rate, the event archives could grow very large and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found