add comment from 063b102461
This commit is contained in:
@@ -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}]`);
|
||||
|
||||
Reference in New Issue
Block a user