-
Notifications
You must be signed in to change notification settings - Fork 190
[FEATURE] Limit/optimize resources used by grok and parse #889
Copy link
Copy link
Closed as not planned
Labels
PPLPiped processing languagePiped processing languageenhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem?
CodeQL says the regex to extract grok patterns is not efficient enough
| public static final Pattern GROK_PATTERN = Pattern.compile( | |
| "%\\{" | |
| + "(?<name>" | |
| + "(?<pattern>[A-z0-9]+)" | |
| + "(?::(?<subname>[A-z0-9_:;,\\-\\/\\s\\.']+))?" | |
| + ")" | |
| + "(?:=(?<definition>" | |
| + "(?:" | |
| + "(?:[^{}]+|\\.+)+" | |
| + ")+" | |
| + ")" | |
| + ")?" | |
| + "\\}"); |
Additionally parse command's regex is only limited by circuit breaker.
Might be possible to add some more checks, or use https://github.com/google/re2j for better worst case performance
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PPLPiped processing languagePiped processing languageenhancementNew feature or requestNew feature or request
Type
Projects
Status
Done