Commit 33e19b4f authored by Alan Szlosek's avatar Alan Szlosek

fix pid parsing in syslog

parent bb2444e4
Pipeline #11194192 passed with stage
in 38 seconds
......@@ -38,15 +38,25 @@ function parseRaw(msg) {
// Syslog messages don't include the year, so set to current year
time.setYear(new Date().getFullYear());
return {
var out = {
facility: facility,
severity: severity,
tag: tag,
time: time,
hostname: hostname,
message: msg.substr(tagIndex + 2)
}
// Extract process name and PID
// Should support this, right? something/else[PID]
var pidIndex = tag.indexOf('[');
var pid;
if (pidIndex != -1) {
pid = tag.substring(pidIndex + 1, tag.length - 1);
out['pid'] = pid;
};
return out;
};
function parseLogFileLine(msg, facility, severity) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment