java.lang.Object
org.elasticsearch.grok.Grok
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe list of values that this Grok can capture.Matches and returns any named captures.getBuiltinPatterns
(boolean ecsCompatibility) Load built-in patterns.getBuiltinPatterns
(String ecsCompatibility) org.joni.Regex
static boolean
isValidEcsCompatibilityMode
(String ecsCompatibility) boolean
match
(byte[] utf8Bytes, int offset, int length, GrokCaptureExtracter extracter) Matches and collects any named captures.boolean
Checks whether a specific text matches the defined grok expression.protected String
converts a grok expression into a named regex expression
-
Field Details
-
ECS_COMPATIBILITY_MODES
-
-
Constructor Details
-
Grok
-
Grok
-
-
Method Details
-
toRegex
converts a grok expression into a named regex expression- Returns:
- named regex expression
-
match
Checks whether a specific text matches the defined grok expression.- Parameters:
text
- the string to match- Returns:
- true if grok expression matches text or there is a timeout, false otherwise.
-
captures
Matches and returns any named captures.- Parameters:
text
- the text to match and extract values from.- Returns:
- a map containing field names and their respective coerced values that matched or null if the pattern didn't match
-
match
Matches and collects any named captures.- Parameters:
utf8Bytes
- array containing the text to match against encoded in utf-8offset
- offsetutf8Bytes
of the start of the textlength
- length of the text to matchextracter
- collector for captures.GrokCaptureConfig.nativeExtracter(org.elasticsearch.grok.GrokCaptureConfig.NativeExtracterMap<T>)
can build these.- Returns:
- true if there was a match, false otherwise
- Throws:
RuntimeException
- if there was a timeout
-
captureConfig
The list of values that this Grok can capture. -
getCompiledExpression
public org.joni.Regex getCompiledExpression() -
getBuiltinPatterns
Load built-in patterns. -
getBuiltinPatterns
-
isValidEcsCompatibilityMode
-