-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
in GlossyParser.parse, a regex is used to detect which RFC was used in received log.
I believe we don't need to use REGEX in this case.
Actual code simplified:
rawMessage = " <34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8"
var segments = rawMessage.split(' ');
if(segments[0].match(/^(<\d+>\d)$/)) {
// RFC 5454
} else if (segments[0].match(/^(<\d+>\d+:)$/)) {
// RFC 3164
} else if (segments[0].match(/^(<\d+>\w+)/)) {
// RFC 3164
}Location: https://github.com/squeeks/glossy/blob/master/lib/glossy/parse.js#L108
Metadata
Metadata
Assignees
Labels
No labels