GithubHelp home page GithubHelp logo

manuelprinz / java-grok Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thekrakken/java-grok

0.0 2.0 0.0 5.34 MB

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

Home Page: http://grok.nflabs.com/

License: Other

Java 100.00%

java-grok's Introduction

Grok

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)

Maven repository

<dependency>
  <groupId>io.thekraken</groupId>
  <artifactId>grok</artifactId>
  <version>0.1.4</version>
</dependency>

Or with gradle

compile "io.thekraken:grok:0.1.4"

Example of how to use java-grok:

/** Create a new grok instance */
Grok grok = Grok.create("patterns/patterns");

/** Grok pattern to compile, here httpd logs */
grok.compile("%{COMBINEDAPACHELOG}");

/** Line of log to match */
String log =
"112.169.19.192 - - [06/Mar/2013:01:36:30 +0900] \"GET / HTTP/1.1\" 200 44346 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.152 Safari/537.22\""

Match gm = grok.match(log);
gm.captures();

/** Get the output */
System.out.println(gm.toJson());

Build Java Grok

Java Grok support Gradle: ./gradlew build

Getting help

Maintainer: @anthonycorbacho

Thankx to

Any contributions are warmly welcome

Grok is inspired by the logstash inteceptor or filter available here

java-grok's People

Contributors

anthonycorbacho avatar hayatbehlim avatar joschi avatar leemoonsoo avatar m-rogers avatar manuelprinz avatar msathaia avatar noord avatar palmerabollo avatar samuelbucheliz avatar sherzberg avatar wouterdb avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.