All Implemented Interfaces:
NamedWriteable, Writeable, PostAnalysisVerificationAware, TelemetryAware, Resolvable, GeneratingPlan<RegexExtract>, SortAgnostic, SortPreserving, Streaming

public class Grok extends RegexExtract implements TelemetryAware, SortPreserving
  • Field Details

  • Constructor Details

  • Method Details

    • pattern

      public static Grok.Parser pattern(Source source, String pattern)
    • pattern

      public static Grok.Parser pattern(Source source, String pattern, MatcherWatchdog matcherWatchdog)
      Builds a parser using the given watchdog to interrupt expensive matches. Used by the local execution planner to bind the node-local esql.grok.watchdog.max_execution_time setting to the matcher that will actually run against real data; parsing/deserialization use the no-op watchdog above since they never execute the pattern against untrusted input.
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • getWriteableName

      public String getWriteableName()
      Specified by:
      getWriteableName in interface NamedWriteable
    • replaceChild

      public UnaryPlan replaceChild(LogicalPlan newChild)
      Specified by:
      replaceChild in class UnaryPlan
    • info

      protected NodeInfo<? extends LogicalPlan> info()
      Description copied from class: Node
      Normally, you want to use one of the static create methods to implement this.

      For QueryPlans, it is very important that the properties contain all of the expressions and references relevant to this node, and that all the properties are used in the provided constructor; otherwise query plan transformations like QueryPlan#transformExpressionsOnly(Function) will not have an effect.

      Specified by:
      info in class Node<LogicalPlan>
    • output

      public List<Attribute> output()
      Description copied from class: QueryPlan
      The ordered list of attributes (i.e. columns) this plan produces when executed. Must be called only on resolved plans, otherwise may throw an exception or return wrong results.
      Overrides:
      output in class RegexExtract
    • withGeneratedNames

      public Grok withGeneratedNames(List<String> newNames)
      Description copied from interface: GeneratingPlan
      Create a new instance of this node with new output Attributes using the given names. If an output attribute already has the desired name, we continue using it; otherwise, we create a new attribute with a new NameId.
      Specified by:
      withGeneratedNames in interface GeneratingPlan<RegexExtract>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class RegexExtract
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class RegexExtract
    • parser

      public Grok.Parser parser()
    • rewriteGrokPattern

      public static void rewriteGrokPattern(StringBuilder sb, String pattern, NodeStringMapper mapper)
      Renders a Grok pattern of shape "%{IP:client_ip} %{NUMBER:bytes:int}". The Grok library identifier (the part before the first :) is a predefined library name (IP, NUMBER, DATA, ...), not customer data — passes through. The capture name routes through mapper.column. The optional type-coercion suffix after the second colon passes through.