Open radu-gheorghe opened 8 years ago
You are exactly right. Oniguruma is used as regex engine for purpose of 100% syntax compatibility with original grok from Logstash. I initially tried to use JavaScript regex engine but it lacks some features (like look-behind constructions). You can read my post about node-grok creation https://memz.co/parsing-log-files-node-js-regex-grok/. I guess, it is possible to create pure-JavaScript library similar to node-grok, but regex syntax would have to be different.
Thanks, @Beh01der! Makes perfect sense now.
So if we can find a non-native library that would support all that Oniguruma supports, would you welcome a PR that replaces Oniguruma? Or do you think it should be kept for some other reason (performance...)? Basically the question is whether it's worth trying to find a solution to remove the native dependency.
It would be nice to have pure JavaScript solution (to be used in browser for example), but I think it would take too much effort to implement
Hi, The newest ECMA supports look-behind construction. Are there any other obstacles to move on JavaScript's regex engine?
https://stackoverflow.com/questions/641407/javascript-negative-lookbehind-equivalent
Is it possible to update the Oniguruma version depency? Otherwise it generates too many build errors.
Hello, I was wondering if we can do something to work around the Oniguruma (native) dependency, which may cause install issues on Windows and possibly other platforms.
Specifically, can we use Node's builtin regex engine, or maybe some other library (with no native dependencies) that provides the regex support needed for grok? I assume Oniguruma is needed for the full PCRE support, so one can be sure that copy-pasting rules from Logstash to node-grok work? Or is there another reason?
Thank you in advance.