public final static String LOG_FILE = "src/test/resources/access_log";
public final static String LOG_DIR_NASA = "src/test/resources/nasa/";
@Test
public void test001_httpd_access() throws GrokException, IOException {
Grok g = Grok.create("patterns/patterns", "%{COMMONAPACHELOG}");
BufferedReader br = new BufferedReader(new FileReader(LOG_FILE));
String line;
System.out.println("Starting test with httpd log");
while ((line = br.readLine()) != null) {
//System.out.println(line);
Match gm = g.match(line);
gm.captures();
assertNotNull(gm.toJson());
assertNotEquals("{\"Error\":\"Error\"}", gm.toJson());
}
br.close();