some cisco routers produce a message of form <32>9032: 51w2d: ... message no hostname, #5

merged 3 commits into from Apr 2, 2012


None yet
2 participants

fygrave commented Mar 18, 2012


@squeeks squeeks commented on the diff Mar 19, 2012

@@ -162,6 +162,14 @@ function parseMessage(rawMessage, callback) {
parsedMessage.message = segments.join(' ');
+ } else if (segments[0].match(/^(<\d+>\d+:)$/)) {
+ parsedMessage.type = 'RFC3164';
+ var timeStamp = segments.splice(0,1).join(' ').replace(/^(<\d+>)/,'');
+ parsedMessage.time = parseTimeStamp(timeStamp);
+ // = segments.shift();
+ = "unknown"; // no host?

squeeks Mar 19, 2012


I think it would be better if this was set to null instead, and the commented line above can be removed.


squeeks commented Mar 19, 2012

Thank you very much for this, however would it be possible for you to include tests? Just look a look at test/parse.js and include some to cover whatever cases are for this.


fygrave commented Mar 19, 2012

Sure. I'll add tests.


fygrave commented Apr 2, 2012

Tests included. I included also some logs generated by buggy (i.e. null included) and non-english systems (chinese this case).


squeeks commented Apr 2, 2012

I can't merge this in until the tests pass, at present your fork is broken.


fygrave commented Apr 2, 2012

Apologize for not testing it on parse.js apriori. I moved my tests to the bottom of the array, so it runs properly now.

@squeeks squeeks added a commit that referenced this pull request Apr 2, 2012

@squeeks squeeks Merge pull request #5 from fygrave/master
Adding support for some Cisco routers and other non-standard output

@squeeks squeeks merged commit b789be3 into squeeks:master Apr 2, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment