Created
April 11, 2016 02:36
-
-
Save duketon/0ae2b8ce527fa69b40a551fe119ed611 to your computer and use it in GitHub Desktop.
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 { | |
file { | |
type => "gatling" | |
path => "/path/to/output.log" | |
start_position => "beginning" | |
} | |
} | |
filter { | |
if ([message] =~ "\bRUN\b" or [message] =~ "\bSTART\b" or [message] =~ "\bEND\b" or [message] =~ "\bGROUP\b") { | |
drop { } | |
} | |
if [type] == "gatling" { | |
grok { | |
match => { "message" => "%{DATA:scenario_name}\t%{NOTSPACE:user_id}\tREQUEST\t%{DATA:group}\t%{DATA:name}\t%{INT:requestStart:int}\t%{INT:requestEnd:int}\t%{INT:responseStart:int}\t%{INT:responseEnd:int}\t%{WORD:status}" } | |
keep_empty_captures => true | |
} | |
mutate { | |
gsub => [ | |
"status", "OK", true, | |
"status", "KO", false | |
] | |
remove_field => ["host", "path", "type"] | |
} | |
mutate { | |
convert => { "status" => "boolean" } | |
} | |
date { | |
match => [ "requestStart", "UNIX_MS" ] | |
} | |
ruby { | |
code => "event['responseDuration'] = (event['responseEnd'] - event['requestStart'])" | |
} | |
} | |
} | |
output { | |
stdout { codec => rubydebug } | |
elasticsearch { | |
hosts => ["localhost:9200"] | |
index => "gatling-%{+YYYY.MM.dd}" | |
codec => "json" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment