X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/770c70870a3e3e3ab59afabce3654687d9bc2cdb..ecb5d5beac1e41d30e47daa6a034c59b33027d12:/cookbooks/logstash/templates/default/logstash.conf.erb diff --git a/cookbooks/logstash/templates/default/logstash.conf.erb b/cookbooks/logstash/templates/default/logstash.conf.erb index 0ddab7b2f..cd5a7d24a 100644 --- a/cookbooks/logstash/templates/default/logstash.conf.erb +++ b/cookbooks/logstash/templates/default/logstash.conf.erb @@ -14,6 +14,19 @@ filter { date { match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ] } + if [agent] == "-" { + mutate { + remove_field => [ "agent" ] + } + } else { + useragent { + source => "agent" + target => "useragent" + } + mutate { + rename => { "agent" => "[useragent][raw]" } + } + } } else if [type] == "rails" { json { source => "message" @@ -26,6 +39,16 @@ filter { ] } } + + if [host] =~ /^spike-/ { + mutate { + add_tag => [ "frontend" ] + } + } else if [host] =~ /^thorn-/ { + mutate { + add_tag => [ "backend" ] + } + } } output {