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'
    }
}
发布了21 篇原创文章 · 获赞 6 · 访问量 2858

猜你喜欢

转载自blog.csdn.net/weixin_43334786/article/details/104863406