I'm trying to convert responsetime from nginx access logs which is in seconds to milliseconds using ruby.
I was able to successfully GROK the access log.
grok {
match => { "message" => "%{IPV4:clientip} - - [%{HTTPDATE:requesttimestamp}] "%{WORD:httpmethod} /" %{NUMBER:responsecode:int} %{NUMBER:responsesize:int} "-" "-" "-" "%{NUMBER:responsetimems:float}""}
}
ruby {
code => "event.set('responsetimems', event.get('responsetimems').to_i * 1000))"
}
Am i doing anything wrong here ?