Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options to remove native dependencies? #15

Open
radu-gheorghe opened this issue Jun 24, 2016 · 5 comments
Open

Options to remove native dependencies? #15

radu-gheorghe opened this issue Jun 24, 2016 · 5 comments

Comments

@radu-gheorghe
Copy link

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.

@Beh01der
Copy link
Owner

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.

@radu-gheorghe
Copy link
Author

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.

@Beh01der
Copy link
Owner

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

@pekunicki
Copy link

pekunicki commented Nov 2, 2018

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

@tbarthelet
Copy link

Is it possible to update the Oniguruma version depency? Otherwise it generates too many build errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants