Skip to content

[FEATURE] Limit/optimize resources used by grok and parse #889

Closed as not planned

Description

@joshuali925

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

Activity

  1. added
    enhancement
    on Oct 5, 2022
  2. added
    PPL
    on Oct 6, 2022
  3. Yury-Fridlyand commented on Nov 2, 2022

    @Yury-Fridlyand
    Collaborator

    For reference: introduced in #813

  4. moved this from Not Started to Won't do in PPL Trackeron Aug 11, 2025
  5. moved this from Won't do to Done in PPL Trackeron Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PPLenhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions