一、安裝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'
}
}