在CentOS系統中,Filebeat的配置文件通常位于/etc/filebeat/filebeat.yml
。以下是關于該配置文件的詳細信息:
/etc/filebeat/filebeat.yml
/usr/bin/filebeat
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/*.log
fields:
type: syslog
output.elasticsearch:
hosts: ["localhost:9200"]
index: "filebeat-%{[agent.version]}-%{+yyyy.MM.dd}"
filebeat.inputs
: 定義了Filebeat要監控的日志文件路徑和其他相關設置。output.elasticsearch
: 指定了Filebeat將日志數據發送到的Elasticsearch集群的地址和索引名稱。使用文本編輯器(如vi
或nano
)打開配置文件:
sudo vi /etc/filebeat/filebeat.yml
根據需要修改配置項。
保存并退出編輯器。
重啟Filebeat服務以應用更改:
sudo systemctl restart filebeat
output.elasticsearch.hosts
中的地址。通過以上步驟,您應該能夠在CentOS系統中找到并修改Filebeat的配置文件。