Convert times in rails log entries to microseconds
authorTom Hughes <tom@compton.nu>
Wed, 1 Jun 2016 21:39:49 +0000 (22:39 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 1 Jun 2016 21:39:49 +0000 (22:39 +0100)
cookbooks/logstash/templates/default/logstash.conf.erb

index fc577b9..6610cd4 100644 (file)
@@ -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-/ {