Class Grok
- All Implemented Interfaces:
NamedWriteable,Writeable,PostAnalysisVerificationAware,TelemetryAware,Resolvable,GeneratingPlan<RegexExtract>,SortAgnostic,SortPreserving,Streaming
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
LogicalPlan.StageNested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.tree.Node
Node.NodeStringFormatNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from class org.elasticsearch.xpack.esql.plan.logical.RegexExtract
extractedFields, inputFields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_LINES, TO_STRING_MAX_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionGrok(Source source, LogicalPlan child, Expression inputExpression, Grok.Parser parser) Grok(Source source, LogicalPlan child, Expression inputExpr, Grok.Parser parser, List<Attribute> extracted) -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()protected NodeInfo<? extends LogicalPlan> info()Normally, you want to use one of the staticcreatemethods to implement this.output()The ordered list of attributes (i.e.parser()static Grok.Parserstatic Grok.Parserpattern(Source source, String pattern, MatcherWatchdog matcherWatchdog) Builds a parser using the given watchdog to interrupt expensive matches.replaceChild(LogicalPlan newChild) static voidrewriteGrokPattern(StringBuilder sb, String pattern, NodeStringMapper mapper) Renders a Grok pattern of shape"%{IP:client_ip} %{NUMBER:bytes:int}".withGeneratedNames(List<String> newNames) Create a new instance of this node with new outputAttributes using the given names.voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.plan.logical.RegexExtract
computeReferences, expressionsResolved, extractedFields, generatedAttributes, input, postAnalysisVerificationMethods inherited from class org.elasticsearch.xpack.esql.plan.logical.UnaryPlan
child, inputSet, outputSet, replaceChildrenMethods inherited from class org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
analyzed, childrenResolved, optimized, preAnalyzed, preOptimized, resolved, setAnalyzed, setOptimized, setPreAnalyzed, setPreOptimizedMethods inherited from class org.elasticsearch.xpack.esql.plan.QueryPlan
computeExpressions, expressions, forEachExpression, forEachExpression, forEachExpressionDown, forEachExpressionUp, references, transformExpressionsDown, transformExpressionsDown, transformExpressionsOnly, transformExpressionsOnly, transformExpressionsOnlyUp, transformExpressionsUp, transformExpressionsUpMethods inherited from class org.elasticsearch.xpack.esql.core.tree.Node
allMatch, anyMatch, children, collect, collect, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachDownMayReturnEarly, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, nodeString, nodeString, propertiesToString, replaceChildrenSameSize, source, sourceLocation, sourceText, toString, toString, toString, transformChildren, transformChildren, transformDown, transformDown, transformDown, transformDown, transformDownSkipBranch, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp, transformUpMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xpack.esql.plan.GeneratingPlan
checkNumberOfNewNamesMethods inherited from interface org.elasticsearch.xpack.esql.capabilities.PostAnalysisVerificationAware
postAnalysisVerificationMethods inherited from interface org.elasticsearch.xpack.esql.capabilities.TelemetryAware
telemetryLabel
-
Field Details
-
ENTRY
-
-
Constructor Details
-
Grok
-
Grok
public Grok(Source source, LogicalPlan child, Expression inputExpr, Grok.Parser parser, List<Attribute> extracted)
-
-
Method Details
-
pattern
-
pattern
Builds a parser using the given watchdog to interrupt expensive matches. Used by the local execution planner to bind the node-localesql.grok.watchdog.max_execution_timesetting 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
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
replaceChild
- Specified by:
replaceChildin classUnaryPlan
-
info
Description copied from class:NodeNormally, you want to use one of the staticcreatemethods 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 likeQueryPlan#transformExpressionsOnly(Function)will not have an effect.- Specified by:
infoin classNode<LogicalPlan>
-
output
Description copied from class:QueryPlanThe 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:
outputin classRegexExtract
-
withGeneratedNames
Description copied from interface:GeneratingPlanCreate a new instance of this node with new outputAttributes 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 newNameId.- Specified by:
withGeneratedNamesin interfaceGeneratingPlan<RegexExtract>
-
equals
- Overrides:
equalsin classRegexExtract
-
hashCode
public int hashCode()- Overrides:
hashCodein classRegexExtract
-
parser
-
rewriteGrokPattern
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 throughmapper.column. The optional type-coercion suffix after the second colon passes through.
-