Advertisement
Guest User

logstash glastopf parser

a guest
Aug 13th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. filter {
  2.     if [type] == "glastopf" {
  3.         grok {
  4.             match => [ "message", "%{TIMESTAMP_ISO8601:logdate} \(%{NOTSPACE:internal_src}\) %{DATA:message}$" ]
  5.             overwrite => [ "message" ]
  6.         }
  7.         date {
  8.             match => [ "logdate", "YYYY-MM-dd HH:mm:ss,SSS" ]
  9.             timezone => "Europe/Berlin"
  10.         }
  11.  
  12.         if [internal_src] == "glastopf.glastopf" {
  13.             grok {
  14.                 match => [ "message", "%{IP:src_ip} requested %{WORD:http_method} %{NOTSPACE:requested_url} on %{HOST:hostname}:%{POSINT:port}" ]
  15.             }
  16.         } else {
  17.             mutate {
  18.                 drop { }
  19.             }
  20.         }
  21.     }
  22.  
  23.     if [src_ip] {
  24.         geoip {
  25.             source => src_ip
  26.         }
  27.  
  28.         geoip {
  29.             source => src_ip
  30.             database => "/opt/logstash/vendor/geoip/GeoIPASNum.dat"
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement