filebeat+redis+logstash+es+kibana 多日志收集

 同时收集本地系统日志和docker 日志

[root@k8-node2-dc ~]#cat    /etc/filebeat/filebeat.yml  
filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /var/log/*.log
    - /var/log/messages
  tags: ["system-log-239"]
  exclude_lines: ['^DBG','^$']

- type: log
  enabled: true
  paths:
    - /var/lib/docker/containers/*/*.log
  tags: ["docker-log-239"]
  exclude_lines: ['^DBG','^$']

filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: true
setup.template.settings:
  index.number_of_shards: 1
output.redis:
  hosts: ["10.1.1.242:6679"]
  db: "10"
  password: "MkdGH*3ldf"
  key: "log-239"
  timeout: 5

enabled: true   开启多路径收集

[root@logstash-28 conf.d]# cat logstas-docker.conf 
input{
    redis {
    host => "10.1.1.242"
    port => "6679"
    password => "MkdGH*3ldf"
    db => "10"
    data_type => "list"
    key => "log-239"
  
}
}
  
output{
    if "docker-log-239" in [tags]  {
       elasticsearch {
            hosts => ["10.1.234.21:9200"]
            index => "docker-log-239-%{+YYYY.MM.dd}"
        }
       stdout{
           codec => rubydebug
       }
    }
}
[root@logstash-28 conf.d]# cat logstas-simple.conf 
input{
    redis {
    host => "10.1.1.242"
    port => "6679"
    password => "MkdGH*3ldf"
    db => "10"
    data_type => "list"
    key => "log-239"
  
}
}
  
output{
    if "system-log-239" in [tags]  {
       elasticsearch {
            hosts => ["10.1.234.21:9200"]
            index => "system-log-239-%{+YYYY.MM.dd}"
        }
       stdout{
           codec => rubydebug
       }
    }
}

创建索引后可以看到如下效果 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值