使用filebeat给多个logstash传输数据

1. filebeat.yml

filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /var/log/messages
    - /var/log/dmesg
    - /var/log/maillog
    - /var/log/boot.log

output.logstash: # 配置重点
    hosts: ["logstash1.linuxtechi.local:5044", "logstash2.linuxtechi.local:5044"] # 填写多个logstash地址
    loadbalance: true  # 开启负载平衡技术

2. logstash.conf

input {
  beats {
    port => 5044
  }
}
output {
  elasticsearch {
    hosts => ["http://elasticsearch1.linuxtechi.local:9200", "http://elasticsearch2.linuxtechi.local:9200", "http://elasticsearch3.linuxtechi.local:9200"]   # 多个elastic地址
    index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
  }
}
posted @ 2019-09-27 14:45  哈喽哈喽111111  阅读(2085)  评论(0编辑  收藏  举报