Converting milliseconds into seconds


(Bini varghese) #1

Hi,
I have captured a field Response time from the log file, but it is in milliseconds, is there a way to convert it in seconds in logstash using any plugin. I tried using mutate but it won't work. Kindly help me out.


(Magnus B├Ąck) #2

Something like

ruby {
  code => "event.set('fieldname', event.get('fieldname').to_f / 1000))"
}

should do it (assuming Logstash 2.4 or later).


(Bini varghese) #3

Thanks @magnusbaeck


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.