在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的配置文件。