logstash-plugins / logstash-filter-grok

Grok plugin to parse unstructured (log) data into something structured.
https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html
Apache License 2.0
122 stars 97 forks source link

Warn when patterns don't have anchors #151

Open jsvd opened 4 years ago

jsvd commented 4 years ago

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 commented 4 years ago

Valid anchors: