Last active
November 3, 2015 12:00
-
-
Save DazWorrall/f2e90293f4aa1d79b8fe to your computer and use it in GitHub Desktop.
Grok config for Magento exception.log
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 => "/path/to/exception.log" | |
type => "magento_exception" | |
codec => multiline { | |
pattern => "^%{TIMESTAMP_ISO8601}" | |
negate => true | |
what => "previous" | |
} | |
} | |
} | |
filter { | |
if [type] == "magento_exception" { | |
grok { | |
match => { "message" => "(?m)%{TIMESTAMP_ISO8601:timestamp}%{SPACE}%{WORD}%{SPACE}\(%{INT}\):(%{SPACE})?\n%{GREEDYDATA:remaining_message}" } | |
} | |
date { | |
match => [ "timestamp", "ISO8601" ] | |
remove_field => [ "timestamp" ] | |
} | |
mutate { | |
rename => { "remaining_message" => "message" } | |
} | |
split { | |
terminator => "Next " | |
} | |
if !("_grokparsefailure" in [tags]) { | |
grok { | |
match => { "message" => "(?m)exception %{QUOTEDSTRING:exception} with message %{DATA:exception_detail} in %{PATH:exception_file}\n%{GREEDYDATA:stack_trace}" } | |
} | |
mutate { | |
gsub => [ | |
"exception", "'", "", | |
"exception_detail", "'", "" | |
] | |
} | |
} | |
} | |
} | |
output { stdout { codec => rubydebug } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment