Tag logstash events as frontend or backend
authorTom Hughes <tom@compton.nu>
Tue, 28 Jul 2015 17:58:27 +0000 (18:58 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 28 Jul 2015 17:58:27 +0000 (18:58 +0100)
cookbooks/logstash/templates/default/logstash.conf.erb

index c036c1f7aab61c23e38b05edcd2198b59df863ad..cd5a7d24ab901095d28cfe3239b57932eb815f41 100644 (file)
@@ -39,6 +39,16 @@ filter {
       ]
     }
   }
+
+  if [host] =~ /^spike-/ {
+    mutate {
+      add_tag => [ "frontend" ]
+    }
+  } else if [host] =~ /^thorn-/ {
+    mutate {
+      add_tag => [ "backend" ]
+    }
+  }
 }
 
 output {