This repository was archived by the owner on Jun 2, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed
src/main/java/com/nflabs/Grok Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
<groupId >com.nflabs</groupId >
6
6
<artifactId >Grok</artifactId >
7
- <version >0.0.1 -SNAPSHOT</version >
7
+ <version >0.0.2 -SNAPSHOT</version >
8
8
<packaging >jar</packaging >
9
9
<name >Grok</name >
10
10
<url >http://maven.apache.org</url >
Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ public Match match( String text ){
155
155
match .match = m ;
156
156
match .start = m .start (0 );
157
157
match .end = m .end (0 );
158
+ match .line = text ;
158
159
return match ;
159
160
}
160
161
return match ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ public class Match {
16
16
public Matcher match ; //regex matcher
17
17
public int start ; //offset
18
18
public int end ; //offset end
19
+ public String line ; //source
19
20
public Garbage garbage ;
20
21
21
22
private String _subject ; //texte
@@ -67,8 +68,9 @@ public int captures(){
67
68
if ( this .match == null )
68
69
return GrokError .GROK_ERROR_UNINITIALIZED ;
69
70
71
+ _capture .put ("LINE" , this .line );
72
+ _capture .put ("LENGTH" , this .line .length () +"" );
70
73
Map <String , String > mappedw = this .match .namedGroups ();
71
- //System.out.println(mappedw);
72
74
Iterator <Entry <String , String >> it = mappedw .entrySet ().iterator ();
73
75
while (it .hasNext ()) {
74
76
You can’t perform that action at this time.
0 commit comments