public class Match extends Object
Match is a representation in Grok world of your log.| Modifier and Type | Field and Description |
|---|---|
static Match |
EMPTY
Create Empty grok matcher.
|
| Constructor and Description |
|---|
Match()
Create a new
Match object. |
| Modifier and Type | Method and Description |
|---|---|
void |
captures()
Match to the subject the regex and save the matched element into a map.
|
int |
getEnd() |
static Match |
getInstance()
Singleton.
|
Matcher |
getMatch() |
int |
getStart() |
String |
getSubject()
Retrurn the single line of log.
|
Boolean |
isNull()
Util fct.
|
void |
setEnd(int end) |
void |
setGrok(Grok grok) |
void |
setMatch(Matcher match) |
void |
setStart(int start) |
void |
setSubject(String text)
Set the single line of log to parse.
|
String |
toJson()
Get the json representation of the matched element.
|
String |
toJson(Boolean pretty)
Get the json representation of the matched element.
|
Map<String,Object> |
toMap()
Get the map representation of the matched element in the text.
|
public static final Match EMPTY
public void setGrok(Grok grok)
public Matcher getMatch()
public void setMatch(Matcher match)
public int getStart()
public void setStart(int start)
public int getEnd()
public void setEnd(int end)
public static Match getInstance()
public void setSubject(String text)
text - : single line of logpublic String getSubject()
public void captures()
public String toJson(Boolean pretty)
example: map [ {IP: 127.0.0.1}, {status:200}] will return {"IP":"127.0.0.1", "status":200}
If pretty is set to true, json will return prettyprint json string.public String toJson()
example: map [ {IP: 127.0.0.1}, {status:200}] will return {"IP":"127.0.0.1", "status":200}
public Map<String,Object> toMap()
public Boolean isNull()
Copyright © 2016. All rights reserved.