Skip to content

Commit

Permalink
Remove redundant nested operator in builtin grok expression. (#47870)
Browse files Browse the repository at this point in the history
This prevents the following warning from being printed to console:
`regular expression has redundant nested repeat operator + /%\{(?<name>(?<pattern>[A-z0-9]+)(?::(?<subname>[[:alnum:]@\[\]_:.-]+))?)(?:=(?<definition>(?:(?:[^{}]+|\.+)+)+))?\}/`

The current grok expression is not failing, but just this warning is being printed.
The warning started being printed after upgrading joni (#47374).

Closes #47861
  • Loading branch information
martijnvg authored Oct 14, 2019
1 parent d308095 commit 9e7cfc8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions libs/grok/src/main/java/org/elasticsearch/grok/Grok.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ public final class Grok {
"(?::(?<subname>[[:alnum:]@\\[\\]_:.-]+))?" +
")" +
"(?:=(?<definition>" +
"(?:" +
"(?:[^{}]+|\\.+)+" +
")+" +
")" +
")?" + "\\}";
private static final Regex GROK_PATTERN_REGEX = new Regex(GROK_PATTERN.getBytes(StandardCharsets.UTF_8), 0,
Expand Down

0 comments on commit 9e7cfc8

Please sign in to comment.