logstash + redis
1010 ワード
1、インストール、redis起動
2、logstashプロファイル
2.1 shipper.conf
2.2 central.conf
0> yum install redis
0> /etc/init.d/redis start
0> netstat -antlp | grep redis
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 2700/redis-server
2、logstashプロファイル
2.1 shipper.conf
input {
file {
path => '/data/logs/nginx/access.log'
start_position => beginning
}
}
output {
stdout {
codec => rubydebug
}
redis {
host => "127.0.0.1"
data_type => "list"
key => "key_count"
}
}
2.2 central.conf
input {
redis {
host => localhost
port => 6379
type => "redis-cluster-input"
data_type => "list"
key => "key_count"
}
}
output {
elasticsearch {
host => localhost
protocol => http
}
stdout {
codec => rubydebug
}
}