Created
December 9, 2015 08:25
-
-
Save oksuz/d95c5bada1778a044ada to your computer and use it in GitHub Desktop.
multi-line php5-fpm logstash configuration
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 { | |
beats { | |
port => 5044 | |
type => "php5-fpm" | |
ssl => true | |
ssl_certificate => "/etc/pki/tls/certs/logstash-forwarder.crt" | |
ssl_key => "/etc/pki/tls/private/logstash-forwarder.key" | |
} | |
} | |
filter { | |
if [type] == "php5-fpm" { | |
grok { | |
match => {"message" => "message: PHP %{WORD:level}:? %{DATA:error_msg} in %{PATH:file}"} | |
add_tag => ["%{level}"] | |
} | |
grok { | |
match => {"message" => "on line %{NUMBER:line}"} | |
} | |
date { | |
match => [ "timestamp" , "yyyy-MM-dd HH:mm:ss", "dd-MMM-yyyy HH:mm:ss ZZZ", "dd-MMM-yyyy HH:mm:sss"] | |
} | |
multiline { | |
pattern => "(Stack trace:)|(#\d+)|(^\"\")|(\s+thrown)|(^\s)|PHP\s+\d\." | |
what => "previous" | |
} | |
mutate { | |
uppercase => ["level"] | |
lowercase => ["tags"] | |
gsub => [ | |
"tags", " ", "_", | |
"level", " ", "_" | |
] | |
} | |
} | |
} | |
output { | |
stdout { codec => rubydebug } | |
elasticsearch { hosts => ["localhost:9200"] } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment