Last active
November 25, 2016 12:31
-
-
Save roopendra/eca2eb6047c7ce47cf2302820aff3242 to your computer and use it in GitHub Desktop.
Logstash conf to parse apache log with geoip and browser agent fields.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
stdin { } | |
} | |
filter { | |
grok { | |
match => { | |
"message" => '%{IPORHOST:clientip} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "%{WORD:verb} %{DATA:request} HTTP/%{NUMBER:httpversion}" %{NUMBER:response:int} (?:-|%{NUMBER:bytes:int}) %{QS:referrer} %{QS:agent}' | |
} | |
} | |
date { | |
match => [ "timestamp", "dd/MMM/YYYY:HH:mm:ss Z" ] | |
locale => en | |
} | |
geoip { | |
source => "clientip" | |
} | |
useragent { | |
source => "agent" | |
target => "useragent" | |
} | |
} | |
output { | |
elasticsearch { | |
hosts => ["localhost:9200"] | |
index => "apache_access_logs" | |
template => "apache_sizing_2.json" | |
template_name => "elk_workshop" | |
template_overwrite => true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment