From 0a538166bcdeb190726abb70a61dc39c5ccacc43 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 1 Jun 2016 22:39:49 +0100 Subject: [PATCH 1/1] Convert times in rails log entries to microseconds --- .../logstash/templates/default/logstash.conf.erb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cookbooks/logstash/templates/default/logstash.conf.erb b/cookbooks/logstash/templates/default/logstash.conf.erb index fc577b9b4..6610cd414 100644 --- a/cookbooks/logstash/templates/default/logstash.conf.erb +++ b/cookbooks/logstash/templates/default/logstash.conf.erb @@ -43,6 +43,21 @@ filter { "[parameters][utf8]" ] } + if [duration] { + ruby { + code => "event['duration'] = Integer(event['duration'] * 1000000)" + } + } + if [db] { + ruby { + code => "event['db'] = Integer(event['db'] * 1000000)" + } + } + if [view] { + ruby { + code => "event['view'] = Integer(event['view'] * 1000000)" + } + } } if [host] =~ /^spike-/ { -- 2.39.5