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

Merged
merged 3 commits into from Apr 2, 2012

Conversation

Projects
None yet
2 participants
Contributor

fygrave commented Mar 18, 2012

...ssage

@squeeks squeeks commented on the diff Mar 19, 2012

lib/glossy/parse.js
@@ -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);
+ //parsedMessage.host = segments.shift();
+ parsedMessage.host = "unknown"; // no host?
@squeeks

squeeks Mar 19, 2012

Owner

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

Owner

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.

Contributor

fygrave commented Mar 19, 2012

Sure. I'll add tests.

Contributor

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).

Owner

squeeks commented Apr 2, 2012

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

Contributor

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
b789be3

@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