Examples of captures()


Examples of oi.thekraken.grok.api.Match.captures()

    BufferedReader br = new BufferedReader(new FileReader(LOG_FILE));
    String line;
    System.out.println("Starting test with linux messages log -- may take a while");
    while ((line = br.readLine()) != null) {
      Match gm = g.match(line);
      gm.captures();
      assertNotNull(gm.toJson());
      assertNotEquals("{\"Error\":\"Error\"}", gm.toJson());
    }
    br.close();
  }
View Full Code Here

Examples of oi.thekraken.grok.api.Match.captures()

    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();
  }
View Full Code Here

Examples of oi.thekraken.grok.api.Match.captures()

    for (File child : dir.listFiles()) {
      br = new BufferedReader(new FileReader(LOG_DIR_NASA + child.getName()));
      while ((line = br.readLine()) != null) {
        //System.out.println(child.getName() + " " +line);
        Match gm = g.match(line);
        gm.captures();
        assertNotNull(gm.toJson());
        assertNotEquals("{\"Error\":\"Error\"}", gm.toJson());
      }
      br.close();
    }
View Full Code Here

Examples of oi.thekraken.grok.api.Match.captures()

  @Test
  public void test001_static_metod_factory() throws Throwable {

    Grok staticGrok = Grok.create("patterns/patterns", "%{USERNAME}");
    Match gm = staticGrok.match("root");
    gm.captures();
    assertEquals("{USERNAME=root}", gm.toMap().toString());

    gm = staticGrok.match("r00t");
    gm.captures();
    assertEquals("{USERNAME=r00t}", gm.toMap().toString());
View Full Code Here

Examples of oi.thekraken.grok.api.Match.captures()

    Match gm = staticGrok.match("root");
    gm.captures();
    assertEquals("{USERNAME=root}", gm.toMap().toString());

    gm = staticGrok.match("r00t");
    gm.captures();
    assertEquals("{USERNAME=r00t}", gm.toMap().toString());

    gm = staticGrok.match("guest");
    gm.captures();
    assertEquals("{USERNAME=guest}", gm.toMap().toString());
View Full Code Here

Examples of oi.thekraken.grok.api.Match.captures()

    gm = staticGrok.match("r00t");
    gm.captures();
    assertEquals("{USERNAME=r00t}", gm.toMap().toString());

    gm = staticGrok.match("guest");
    gm.captures();
    assertEquals("{USERNAME=guest}", gm.toMap().toString());

    gm = staticGrok.match("guest1234");
    gm.captures();
    assertEquals("{USERNAME=guest1234}", gm.toMap().toString());
View Full Code Here

Examples of oi.thekraken.grok.api.Match.captures()

    gm = staticGrok.match("guest");
    gm.captures();
    assertEquals("{USERNAME=guest}", gm.toMap().toString());

    gm = staticGrok.match("guest1234");
    gm.captures();
    assertEquals("{USERNAME=guest1234}", gm.toMap().toString());

    gm = staticGrok.match("john doe");
    gm.captures();
    assertEquals("{USERNAME=john}", gm.toMap().toString());
View Full Code Here

Examples of oi.thekraken.grok.api.Match.captures()

    gm = staticGrok.match("guest1234");
    gm.captures();
    assertEquals("{USERNAME=guest1234}", gm.toMap().toString());

    gm = staticGrok.match("john doe");
    gm.captures();
    assertEquals("{USERNAME=john}", gm.toMap().toString());
  }


  @Test
View Full Code Here

Examples of oi.thekraken.grok.api.Match.captures()

    g.addPatternFromFile("patterns/patterns");
    g.compile("%{USERNAME}");

    Match gm = g.match("root");
    gm.captures();
    assertEquals("{USERNAME=root}", gm.toMap().toString());

    gm = g.match("r00t");
    gm.captures();
    assertEquals("{USERNAME=r00t}", gm.toMap().toString());
View Full Code Here

Examples of oi.thekraken.grok.api.Match.captures()

    Match gm = g.match("root");
    gm.captures();
    assertEquals("{USERNAME=root}", gm.toMap().toString());

    gm = g.match("r00t");
    gm.captures();
    assertEquals("{USERNAME=r00t}", gm.toMap().toString());

    gm = g.match("guest");
    gm.captures();
    assertEquals("{USERNAME=guest}", gm.toMap().toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.