This repository was archived by the owner on Jun 2, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/main/java/com/nflabs/Grok Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,8 @@ public int addPatternFromFile( String file) throws Throwable{
118
118
File f = new File (file );
119
119
if (!f .exists ())
120
120
return GrokError .GROK_ERROR_FILE_NOT_ACCESSIBLE ;
121
+ if ( !f .canRead () )
122
+ return GrokError .GROK_ERROR_FILE_NOT_ACCESSIBLE ;
121
123
122
124
BufferedReader br = new BufferedReader (new FileReader (file ));
123
125
String line ;
@@ -191,10 +193,11 @@ public int compile( String pattern ){
191
193
}
192
194
_captured_map .put ( "name" +index , (group .get ("subname" ) != null ? group .get ("subname" ):group .get ("name" )));
193
195
_expanded_pattern = StringUtils .replace (_expanded_pattern , "%{" +group .get ("name" )+"}" , "(?<name" +index +">" + this .patterns .get (group .get ("pattern" ))+")" );
194
- //System.out.println(expanded_pattern );
196
+ //System.out.println(_expanded_pattern );
195
197
index ++;
196
198
}
197
199
}
200
+ //System.out.println(_captured_map);
198
201
//Compile the regex
199
202
if (!_expanded_pattern .isEmpty ()){
200
203
_regexp = Pattern .compile (_expanded_pattern );
You can’t perform that action at this time.
0 commit comments