Skip to content

Instantly share code, notes, and snippets.

@Lax
Created August 3, 2015 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lax/ae238bc9e8c0d53f5f0f to your computer and use it in GitHub Desktop.
Save Lax/ae238bc9e8c0d53f5f0f to your computer and use it in GitHub Desktop.
logstash.conf for ngx_http_accounting_module
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