Created
September 24, 2015 06:30
-
-
Save phumpal/cc9d8fa428f2df6495e9 to your computer and use it in GitHub Desktop.
Redis Logstash Filter
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 { | |
file { | |
path => "/var/log/redis/redis-server.log" | |
start_position => "beginning" | |
type => "redis" | |
add_field => { "role" => "redis" } | |
} | |
} | |
filter { | |
if [type] == "redis" { | |
grok { | |
pattern => [ "%{POSINT:redis_pid}:[A-Z] %{MONTHDAY} %{MONTH} %{HOUR}:%{MINUTE}:%{SECOND} \* %{GREEDYDATA:redis_message}" ] | |
} | |
mutate { | |
remove_field => "message" | |
} | |
mutate { | |
rename => [ "redis_message", "message" ] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Newer versions seem to include the year, also some messages have a # instead of a *