]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/logstash/templates/default/logstash.conf.erb
Update chef client to 12.21.3
[chef.git] / cookbooks / logstash / templates / default / logstash.conf.erb
index cd5a7d24ab901095d28cfe3239b57932eb815f41..6610cd414e2c906ba3342c17c0be1126b6fa1514 100644 (file)
@@ -23,6 +23,11 @@ filter {
         source => "agent"
         target => "useragent"
       }
         source => "agent"
         target => "useragent"
       }
+      grok {
+        match => { "agent" => "%{JOSM:[useragent][name]=JOSM}/%{POSINT:[useragent][major]}\.%{POSINT:[useragent][minor]} \(%{POSINT:[useragent][patch]} \w+\) " }
+        overwrite => [ "[useragent][name]", "[useragent][major]", "[useragent][minor]", "[useragent][patch]" ]
+        tag_on_failure => []
+      }
       mutate {
         rename => { "agent" => "[useragent][raw]" }
       }
       mutate {
         rename => { "agent" => "[useragent][raw]" }
       }
@@ -38,6 +43,21 @@ filter {
         "[parameters][utf8]"
       ]
     }
         "[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-/ {
   }
 
   if [host] =~ /^spike-/ {
@@ -53,7 +73,6 @@ filter {
 
 output {
   elasticsearch {
 
 output {
   elasticsearch {
-    host => [ "127.0.0.1" ]
-    cluster => "<%= node[:elasticsearch][:cluster][:name] %>"
+    hosts => [ "127.0.0.1" ]
   }
 }
   }
 }