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}]`);