Skip to content

ekneg54/rust-grok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rustgrok

rustgrok is a python wrapper for the rust grok library written by Michael Nitchinger(https://github.com/daschl/grok).

Installation

pip install rustgrok

Usage

grok = rustgrok.Grok()
grok.compile("%{IP:client} %{WORD:method} %{URIPATHPARAM:request} %{NUMBER:bytes} %{NUMBER:duration}")
result = grok.match_against("55.3.244.1 GET /index.html 15824 0.043")
assert result.get("client") == "55.3.244.1"
assert result.get("method") == "GET"
assert result.get("request") == "/index.html"
assert result.get("bytes") == "15824"
assert result.get("duration") == "0.043"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published