# tar zxvf logstash-2.4.0.tar.gz -C /usr/localredis
# cd /usr/local/logstash-2.4.0/json
# mkdir conf logsvim
# vim conf/central.conf elasticsearch
input {spa
redis {#輸入配置,這是使用本機rediscode
host => "127.0.0.1"blog
port => 6379input
type => "redis-input"it
data_type => "list"ast
key => "key_count"
}
}
output {
stdout {}
elasticsearch {#輸出信息配置,這裏使用elasticsearch
hosts => "localhost:9200"
codec => "json"
index => "logstash-%{+YYYY.MM.dd}"
}
}
# :wq!
# bin/logstash agent --verbose --config conf/central.conf –log logs/stdout.log