Skip to content

Instantly share code, notes, and snippets.

@alexanderilyin
Created June 18, 2015 22:33
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 alexanderilyin/53b5f17ab700706bdef4 to your computer and use it in GitHub Desktop.
Save alexanderilyin/53b5f17ab700706bdef4 to your computer and use it in GitHub Desktop.
filter {
if [type] == 'php-fpm-slow-log' {
# Drop empty lines
if [message] =~ /^\s*$/ {
drop { }
}
# Time prefix appears on each line
multiline {
pattern => "^(\[0x0|script_filename|$)"
what => "previous"
}
grok {
patterns_dir => "/etc/logstash/patterns/"
match => [ "message", "(?m)%{PHP_FPM_SLOW_LOG}" ]
}
date {
match => [ "timestamp" , "dd-MMM-yyyy HH:mm:ss" ]
target => "@timestamp"
remove_field => "timestamp"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment