From e8a9bd83d3705d73a61fe09891480e813fe5078f Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 15 Sep 2025 14:01:47 +0200 Subject: [PATCH] add comment from 063b1024616706971d4a1f9c50b5032727640120 --- syslog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syslog.js b/syslog.js index 94ccac3b5..e83c6378c 100755 --- a/syslog.js +++ b/syslog.js @@ -28,7 +28,7 @@ function parseRFC5424Message(rawMessage) { const { priority, version, timestamp, hostname, appName, procId, msgId, structuredData, message } = match.groups; return { - pri: parseInt(priority, 10), // priority + pri: parseInt(priority, 10), // priority version: parseInt(version, 10), // version timestamp, // timestamp hostname, // hostname @@ -53,7 +53,7 @@ async function start() { gServer.on('connection', function (socket) { socket.on('data', function (data) { - const msg = data.toString('utf8').trim(); // strip any trailing empty new lines + const msg = data.toString('utf8').trim(); // strip any trailing empty new lines. it's unclear why we get it in the first place for (const line of msg.split('\n')) { // empirically, multiple messages can arrive in a single packet const info = parseRFC5424Message(line); if (!info) return debug(`Unable to parse: [${msg}]`);