Skip to content

Instantly share code, notes, and snippets.

@GuillaumeDievart
Created January 8, 2015 18:43
Show Gist options
  • Save GuillaumeDievart/32f7cc4d8863c5e13d5d to your computer and use it in GitHub Desktop.
Save GuillaumeDievart/32f7cc4d8863c5e13d5d to your computer and use it in GitHub Desktop.
logstash for magento exception
input {
file {
type => "magento-exception"
path => "/path/to/magento/www/var/log/exception.log"
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601}"
negate => true
what => previous
}
}
}
filter {
if [type] == "magento-exception" {
mutate {
gsub => ["message", "\n", " "]
}
grok {
match => [ "message", "%{TIMESTAMP_ISO8601:date} %{GREEDYDATA:exception} Stack trace: %{GREEDYDATA:stack_trace}" ]
}
}
}
output {
elasticsearch {
protocol => "http"
host => "localhost"
port => 9200
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment