Skip to content

arcodergh/java-grok

 
 

Repository files navigation

Build Status

Java Grok is simple API that allows you to easily parse logs and other files (single line). With Java Grok, you can turn unstructured log and event data into structured data (JSON).


What can I use Grok for?

  • reporting errors and other patterns from logs and processes
  • parsing complex text output and converting it to json for external processing
  • apply 'write-once use-everywhere' to regular expressions
  • automatically providing patterns for unknown text inputs (logs you want patterns generated for future matching)

Include Java Grok into your java project and use it like:

Grok g = new Grok();
g.addPatternFromFile(/path/to/pattern);
g.compile("%{URI}");
Match gm = g.match(yourlog);
gm.captures();
//See the result
System.out.println(gm.toJson());

Maven repository

<dependency>
  <groupId>com.nflabs</groupId>
  <artifactId>grok</artifactId>
  <version>0.0.5</version>
</dependency>

Build Java Grok

Java Grok support Maven and Gradle

  1. Maven mvn package.
  2. Gradle gradle build, If you dont have gradle installed you can use ./gradlew build.

Getting help

Maintainer: @anthonycorbacho

Thankx to

Any contributions are warmly welcome

About

Simple API that allows you to easily parse logs and other files

Resources

License

Stars

Watchers

Forks

Packages

No packages published