systemd / systemd-netlogd

Forwards messages from the journal to other hosts over the network using syslog format RFC 5424 and RFC 3164
GNU General Public License v2.0
69 stars 25 forks source link

Mangled/merged syslog messages via UDP and RFC5424 #102

Closed cipriancraciun closed 3 months ago

cipriancraciun commented 3 months ago

I've built the latest v1.4 tag (on an OpenSUSE Leap 15.5), and I've tried to use the following configuration:

[Network]
Address = 172...:514
Protocol = udp
LogFormat = rfc5424
UseSysLogMsgId = yes
UseSysLogStructuredData = yes
SendBuffer = 65536

On the remote syslog target, I observe that some of the received syslog messages are mangled in non-expected ways:

This happens mainly when the second packet is a large one, larger than the MTU, but smaller than 16K (or so).

(If I replace systemd-netlogd with a simple socat -u unix-recv:/run/systemd/journal/syslog udp:172...:514, the issue seems to disappear. Granted, that uses RFC-3164, and doesn't do any additional processing.)

(This issue is related with https://github.com/systemd/systemd/issues/32852)

cipriancraciun commented 3 months ago

Sorry for the false alarm. The issue was in the code I was using (I retained the received buffer longer than I was supposed to, and thus it got overwritten).