X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/b1019dc608b9fd11d4fd07bd096e9cc24b6cdd05..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 e4546bb01..cd5a7d24a 100644 --- a/cookbooks/logstash/templates/default/logstash.conf.erb +++ b/cookbooks/logstash/templates/default/logstash.conf.erb @@ -9,17 +9,44 @@ input { filter { if [type] == "apache" { grok { - match => [ "message", "%{COMBINEDAPACHELOG} %{NUMBER:duration:int}us %{WORD:request_id} %{NOTSPACE:ssl_protocol} %{NOTSPACE:ssl_cipher}" ] + match => [ "message", "%{COMBINEDAPACHELOG} %{NUMBER:duration:int}us %{NOTSPACE:request_id} %{NOTSPACE:ssl_protocol} %{NOTSPACE:ssl_cipher}" ] } 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" ] } } }