一、安装redis
过程不再叙述,可参考我之前的博文《Redis单机多实例集群部署》。
二、配置filebeat
filebeat.inputs:
- type: log
tail_files: true
backoff: "1s"
paths:
- /usr/local/nginx/logs/access.json.log
fields:
type: access
#此处fields_under_root: true意为我们新增的fields下面的type为
fields_under_root: true
output:
redis:
hosts: ["10.1.1.17"]
port: 6379
password: '123456'
key: 'access'
三、配置logstash的conf文件:
input {
redis {
host => '10.1.1.17'
port => 6379
key => "access"
data_type => "list"
password => '123456'
}
}