Filebeat和Logstash間引入Redis

一、安裝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'
    }
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章