X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/4689f34a5beea969804f6305c3ff0cd76e8143e3..85fe9aab2a52542caf1c9479ee627b25a5762a28:/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 7608e2b5b..cd5a7d24a 100644 --- a/cookbooks/logstash/templates/default/logstash.conf.erb +++ b/cookbooks/logstash/templates/default/logstash.conf.erb @@ -14,12 +14,39 @@ 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" + remove_field => [ + "message", + "[parameters][authenticity_token]", + "[parameters][pass_crypt]", + "[parameters][pass_crypt_confirmation]", + "[parameters][utf8]" + ] + } + } + + if [host] =~ /^spike-/ { + mutate { + add_tag => [ "frontend" ] } + } else if [host] =~ /^thorn-/ { mutate { - remove_field => [ "message" ] + add_tag => [ "backend" ] } } }