Skip to content

phillip/node-grok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-grok

What is it ?

It's a NodeJS implementation of ruby-grok.

Requires libgrok to be installed.

Usage

Installing libgrok

Mac OS: brew install grok

Debian unstable: apt-get install libgrok1 libgrok-dev

Please refer to the Grok Homepage for further instructions

Basic Usage

var grok = require('node-grok'); // or require('./lib/grok.js')
matcher = grok.create()
matcher.addPatternsFromFile('./patterns/base')

matcher.compile("%{IP:ip_address} %{WORD:text}")
res = matcher.match("does not match") // false
res = matcher.match("127.0.0.1 home")

res.captures()
{ ip_address: [ '127.0.0.1' ],
  text: [ 'home' ] }

About

a node.js reimplementation of ruby-grok

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published