add comment from 063b102461

This commit is contained in:
Girish Ramakrishnan
2025-09-15 14:01:47 +02:00
parent 8d32c853d5
commit e8a9bd83d3

View File

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