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

Warn when patterns don't have anchors #151

Open
jsvd opened this issue Oct 21, 2019 · 1 comment
Open

Warn when patterns don't have anchors #151

jsvd opened this issue Oct 21, 2019 · 1 comment

Comments

@jsvd
Copy link
Contributor

jsvd commented Oct 21, 2019

Configuring grok patterns without putting anchors such as ^ (match to the beginning of the line) or $ (match the end of the line) can cause the regex engine to perform extra work in trying to match the input to the given pattern.

This leads to resource consumption and slower pipelines, as investigated in this blog post.

Logging a warning to users about patterns that aren't anchored could improve the overall performance of grok parsing.

@yaauie
Copy link
Contributor

yaauie commented Oct 22, 2019

Valid anchors:

  • ^ beginning-of-line
  • $ end-of-line
  • \A start-of-input
  • \z end-of-input

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

2 participants