Created
December 8, 2016 03:37
-
-
Save mingder78/4fa524db8cce492f7166d2cbaa4c5f38 to your computer and use it in GitHub Desktop.
apache-error-log.conf
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 { | |
path => [ "/diskZ/elklog/axa/ssm*/error_log*" ] | |
start_position => beginning | |
type => "axa-apache-error" | |
sincedb_path => "/dev/null" | |
ignore_older => 0 | |
} | |
} | |
filter { | |
if [type] == "axa-apache-error" { | |
grok { | |
match => { "message" => "\[%{DAY} (?<timestamp>%{MONTH} %{MONTHDAY} %{TIME} %{YEAR})\] \[%{LOGLEVEL:loglevel}\] (?:\[client %{IP:clientip}\] ){0,1}%{GREEDYDATA:errormsg}" } | |
} | |
date { | |
match => [ "timestamp" , "MMM dd HH:mm:ss YYYY" ] | |
} | |
geoip { | |
source => "clientip" | |
} | |
} | |
} | |
output { | |
if [type] == "axa-apache-error" { | |
elasticsearch { | |
hosts => ["localhost:9200"] | |
index => "logstash-axa-errorlog-%{+YYYY.MM.dd}" | |
} | |
#stdout { codec => rubydebug } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment