Skip to content

Instantly share code, notes, and snippets.

@duketon
Created April 11, 2016 02:36
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 duketon/0ae2b8ce527fa69b40a551fe119ed611 to your computer and use it in GitHub Desktop.
Save duketon/0ae2b8ce527fa69b40a551fe119ed611 to your computer and use it in GitHub Desktop.
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