public class Match extends Object
Match is a representation in Grok world of your log.| 构造器和说明 |
|---|
Match(CharSequence subject,
Grok grok,
RegexpMatcher match,
int start,
int end)
Create a new
Match object. |
| 限定符和类型 | 方法和说明 |
|---|---|
Map<String,Object> |
capture()
Match to the subject the regex and save the matched element into a map.
|
Map<String,Object> |
captureFlattened()
Match to the subject the regex and save the matched element into a map
Multiple values to the same key are flattened to one value: the sole non-null value will be captured.
|
int |
getEnd() |
RegexpMatcher |
getMatch() |
int |
getStart() |
CharSequence |
getSubject()
Retrurn the single line of log.
|
boolean |
isKeepEmptyCaptures() |
Boolean |
isNull()
Util fct.
|
void |
setKeepEmptyCaptures(boolean ignore)
Ignore empty captures.
|
public static final Match EMPTY
public Match(CharSequence subject, Grok grok, RegexpMatcher match, int start, int end)
Match object.public RegexpMatcher getMatch()
public int getStart()
public int getEnd()
public void setKeepEmptyCaptures(boolean ignore)
public boolean isKeepEmptyCaptures()
public CharSequence getSubject()
public Map<String,Object> capture()
public Map<String,Object> captureFlattened() throws GrokException
capture which returns multiple values of the same key as list.GrokException - if a keys has multiple non-null values.public Boolean isNull()
Copyright © 2022. All rights reserved.