Skip to content

Instantly share code, notes, and snippets.

@DazWorrall
Last active November 3, 2015 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DazWorrall/f2e90293f4aa1d79b8fe to your computer and use it in GitHub Desktop.
Save DazWorrall/f2e90293f4aa1d79b8fe to your computer and use it in GitHub Desktop.
Grok config for Magento exception.log
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