Last active
October 12, 2017 21:05
-
-
Save ggtools/fe1f1c228ecb58693ed5 to your computer and use it in GitHub Desktop.
Logstash configuration for Docker + Spring Boot applications
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 { | |
gelf { | |
type => docker | |
port => 12201 | |
} | |
} | |
filter { | |
multiline { | |
pattern => "^%{TIMESTAMP_ISO8601}" | |
negate => true | |
what => "previous" | |
source => "short_message" | |
} | |
grok { | |
match => { "short_message" => "^%{TIMESTAMP_ISO8601}\s+%{LOGLEVEL:log_level}\s+%{NUMBER:pid}\s+---\s+\[\s*%{USERNAME:thread}\s*\]\s+%{DATA:class}\s*:\s*%{DATA:log_message}(?:\n%{GREEDYDATA:stack})?\n*$" } | |
} | |
if "_grokparsefailure" in [tags] { | |
mutate { | |
replace => { "message" => "%{short_message}" } | |
} | |
} | |
else { | |
mutate { | |
replace => { "message" => "%{log_message}" } | |
replace => { "level" => "%{log_level}"} | |
remove_field => [ "log_level", "log_message" ] | |
} | |
} | |
} | |
output { | |
#stdout { | |
# codec => rubydebug | |
#} | |
elasticsearch { | |
host => db | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment