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

Grok type not working #29

Open
pchakour opened this issue Aug 14, 2020 · 0 comments
Open

Grok type not working #29

pchakour opened this issue Aug 14, 2020 · 0 comments

Comments

@pchakour
Copy link

Hello,

I'm trying to use the grok-js module with the following pattern :
%{TIMESTAMP_ISO8601:date} \| %{IP:client} \| %{WORD:method} \| %{URIPATHPARAM:request} \| %{NUMBER:bytes:int} \| %{NUMBER:duration:int}

and the following line :
2018-04-11 15:26:04.756 | 192.168.0.19 | GET | /uri | 18 | 2

Unfortunately, the module doesn't work with types. If I change the pattern like this
%{TIMESTAMP_ISO8601:date} \| %{IP:client} \| %{WORD:method} \| %{URIPATHPARAM:request} \| %{NUMBER:bytes} \| %{NUMBER:duration}

Everything works.

So to fix this issue, I had to change the subPatternsRegex

From

 const subPatternsRegex = /%\{[A-Z0-9_]+(?::[A-Za-z0-9_]+)?\}/g;

To

const subPatternsRegex = /%\{[A-Z0-9_]+(?::[A-Za-z0-9_]+)?(?::[a-z]+)?\}/g;
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

1 participant