X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/85fe9aab2a52542caf1c9479ee627b25a5762a28..55fc22bb3b3c7adfd60c2c4865e52d71c7de3572:/cookbooks/logstash/templates/default/logstash.conf.erb?ds=inline diff --git a/cookbooks/logstash/templates/default/logstash.conf.erb b/cookbooks/logstash/templates/default/logstash.conf.erb index cd5a7d24a..6610cd414 100644 --- a/cookbooks/logstash/templates/default/logstash.conf.erb +++ b/cookbooks/logstash/templates/default/logstash.conf.erb @@ -23,6 +23,11 @@ filter { 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]" } } @@ -38,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-/ { @@ -53,7 +73,6 @@ filter { output { elasticsearch { - host => [ "127.0.0.1" ] - cluster => "<%= node[:elasticsearch][:cluster][:name] %>" + hosts => [ "127.0.0.1" ] } }