Created
November 12, 2014 13:22
-
-
Save djodjoni/38f949a1fd863d427bd8 to your computer and use it in GitHub Desktop.
logstash conf FOR iis
This file contains hidden or 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 { | |
file { | |
type => iis | |
path => /Users/sic/works/logs/*.log | |
} | |
} | |
filter { | |
#ignore log comments | |
if [message] =~ ^# { | |
drop {} | |
} | |
grok { | |
match => [message, %{TIMESTAMP_ISO8601:log_timestamp} %{WORD:iisSite} %{IPORHOST:site} %{WORD:method} %{URIPATH:page} %{NOTSPACE:querystring} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:clienthost} %{NOTSPACE:useragent} %{NOTSPACE:referer} %{NUMBER:response} %{NUMBER:subresponse} %{NUMBER:scstatus} %{NUMBER:bytes:int} %{NUMBER:timetaken:int}] | |
} | |
#Set the Event Timesteamp from the log | |
date { | |
match => [ log_timestamp, YYYY-MM-dd HH:mm:ss ] | |
timezone => Etc/UCT | |
} | |
ruby{ code => event[kilobytes] = event[bytes] / 1024.0 } | |
#https://logstash.jira.com/browse/LOGSTASH-1354 | |
#geoip{ | |
# source => clienthost | |
# add_tag => [ geoip ] | |
#} | |
useragent { | |
source=> useragent | |
prefix=> browser | |
} | |
mutate { | |
remove_field => [ log_timestamp] | |
} | |
} | |
output { | |
elasticsearch { | |
host => 127.0.0.1 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment