Created
August 3, 2015 07:27
-
-
Save Lax/ae238bc9e8c0d53f5f0f to your computer and use it in GitHub Desktop.
logstash.conf for ngx_http_accounting_module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
stdin {} | |
} | |
filter { | |
grok { | |
match => [ "message", "^%{SYSLOGTIMESTAMP:timestamp}\|\| pid:\d+\|from:\d{10}\|to:\d{10}\|accounting_id:%{WORD:accounting}\|requests:%{NUMBER:req:int}\|bytes_out:%{NUMBER:size:int}\|%{DATA:status}"] | |
} | |
kv { | |
target => "code" | |
source => "status" | |
field_split => "|" | |
value_split => ":" | |
} | |
ruby { | |
code => "n={};event['code'].each_pair{|x,y|n[x]=y.to_i};event['code']=n" | |
} | |
} | |
output { | |
stdout { codec => rubydebug } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment