-
-
Save tuapuikia/db51f1e2048822b4598620cba3d17626 to your computer and use it in GitHub Desktop.
Logstash parser for PHP's error_log to combine multline stack traces / errors into one event
This file contains 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 { | |
stdin { | |
codec => multiline { | |
pattern => "^\[%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME} %{TZ}\]" | |
negate => true | |
what => "previous" | |
auto_flush_interval => 10 | |
} | |
type => "php-error" | |
} | |
} | |
filter { | |
grok { | |
match => { "message" => "^\[(?<logtime>%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME} %{TZ})\] ?%{GREEDYDATA:message}" } | |
overwrite => [ "message" ] | |
} | |
date { | |
match => [ "logtime", "d-MMM-yyyy HH:mm:ss ZZZ" ] | |
remove_field => [ "logtime" ] | |
} | |
} | |
output { | |
stdout { | |
codec => rubydebug | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment