代码语言:javascript复制
用途
监控redis数据
配置示例
input {
redis {
data_type => "list"
key => "logstash-demo"
host => "127.0.0.1"
port => 6379
threads => 5
}
}
output {
stdout {
codec => rubydebug
}
}
启动
bin/logstash -f /etc/logstash/conf.d/demo-input-redis.conf
测试
redis-cli -h 127.0.0.1
rpush logstash-demo test
结果
{
"@timestamp" => 2017-06-12T13:55:11.689Z,
"@version" => "1",
"message" => "test",
"tags" => [
[0] "_jsonparsefailure"
]
}
date_type 只能是list(使用BLPOP获取消息)、channel(使用SUBSCRIBE获取消息)、pattern_channel(使用PSUBSCRIBE获取消息)