Converting milliseconds into seconds

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.

Something like

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

should do it (assuming Logstash 2.4 or later).

1 Like

Thanks @magnusbaeck

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