public class Grok extends Object
Grok parse arbitrary text and structure it.
Grok is simple API that allows you to easily parse logs
and other files (single line). With Grok,
you can turn unstructured log and event data into structured data.| Modifier and Type | Field and Description |
|---|---|
Map<String,io.krakens.grok.api.Converter.IConverter<? extends Object>> |
converters |
Map<String,Converter.Type> |
groupTypes |
Set<String> |
namedGroups |
| Constructor and Description |
|---|
Grok(String pattern,
String namedRegex,
Map<String,String> namedRegexCollection,
Map<String,String> patternDefinitions,
java.time.ZoneId defaultTimeZone) |
| Modifier and Type | Method and Description |
|---|---|
ArrayList<Map<String,Object>> |
capture(List<String> logs)
Match the given list of log with the named regex
and return the list of json representation of the matched elements.
|
Map<String,Object> |
capture(String log)
Match the given log with the named regex.
|
String |
discover(String input)
Grok will try to find the best expression that will match your input. |
String |
getNamedRegex()
Get the named regex from the
Grok pattern. |
Map<String,String> |
getNamedRegexCollection()
Get the full collection of the named regex.
|
String |
getNamedRegexCollectionById(String id)
Get the named regex from the given id.
|
String |
getOriginalGrokPattern()
Original grok pattern used to compile to the named regex.
|
Map<String,String> |
getPatterns()
Get the current map of
Grok pattern. |
String |
getSaved_pattern() |
Match |
match(CharSequence text)
Match the given text with the named regex
Grok will extract data from the string and get an extence of Match. |
void |
setSaved_pattern(String savedpattern) |
public final Map<String,Converter.Type> groupTypes
public String getSaved_pattern()
public void setSaved_pattern(String savedpattern)
public Map<String,String> getPatterns()
Grok pattern.public String getNamedRegex()
Grok pattern. public String getOriginalGrokPattern()
public String getNamedRegexCollectionById(String id)
id - : named regex idpublic Map<String,String> getNamedRegexCollection()
public Map<String,Object> capture(String log)
log - : log to matchpublic ArrayList<Map<String,Object>> capture(List<String> logs)
logs - : list of logpublic Match match(CharSequence text)
Grok will extract data from the string and get an extence of Match.text - : Single line of logCopyright © 2019. All rights reserved.