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}"
}
}