你说的 “debian filebeat 怎么转输”,我理解为:在 Debian 系统上如何配置 Filebeat 把日志传输(转发)到目标(如 Elasticsearch、Logstash、Kafka 等)。下面按常见场景说明。
sudo apt update
sudo apt install filebeat -y
安装后配置文件通常在:
/etc/filebeat/filebeat.yml
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/*.log
- /var/log/nginx/access.log
output.elasticsearch:
hosts: ["http://192.168.1.10:9200"]
username: "elastic"
password: "your_password"
启动:
sudo systemctl enable filebeat
sudo systemctl start filebeat
output.logstash:
hosts: ["192.168.1.20:5044"]
Logstash 需开启 beats 输入:
input {
beats {
port => 5044
}
}
output.kafka:
hosts: ["kafka1:9092", "kafka2:9092"]
topic: "filebeat-logs"
output.file:
path: "/tmp/filebeat-out"
filename: "filebeat.json"
sudo filebeat test config
sudo filebeat test output
sudo systemctl status filebeat
journalctl -u filebeat -f
enabled: truesudo chmod 644 /var/log/*.log
如果你能具体说:
我可以给你一份 完整可直接用的 filebeat.yml。