1、File to Redis
input {
file {
type => "type_count"
path => ["/data/logs/count/stdout.log", "/data/logs/count/stderr.log"]
exclude => ["*.gz", "access.log"]
}
}
output {
stdout {}
redis {
host => "20.8.40.49"
port => 6379
data_type => "list"
key => "key_count"
}
}
2、Redis to elasticsearch
input {
redis {
host => "127.0.0.1"
port => 6379
type => "redis-input"
data_type => "list"
key => "key_count"
}
}
output {
stdout {}
elasticsearch {
cluster => "elasticsearch"
codec => "json"
protocol => "http"
}
}