-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
I have some sample code which seems like it should work, but does not:
'use strict';
const grok = require('node-grok');
const patterns = grok.loadDefaultSync(["grok-patterns","linux-syslog"]);
const test = "<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - message"
const pattern = patterns.getPattern('SYSLOG5424LINE');
const parsed = pattern.parseSync(test);
console.log(parsed); // "null"If I make this change, it works. Is it a bug or pilot error?
index 0de33ff..353e506 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -171,7 +171,7 @@ function GrokCollection() {
};
t.getPattern = function (id) {
- return patterns.get(id);
+ return resolvePattern(patterns.get(id));
};
michaelb87
Metadata
Metadata
Assignees
Labels
No labels