在Ubuntu系统中,Filebeat的配置文件通常位于/etc/filebeat/filebeat.yml
。以下是关于该文件的详细信息:
默认路径:
/etc/filebeat/filebeat.yml
检查安装方式:
apt-get
)安装的Filebeat,配置文件通常会在上述路径下。一个基本的filebeat.yml
配置文件可能包含以下内容:
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/*.log
output.elasticsearch:
hosts: ["localhost:9200"]
index: "filebeat-%{[agent.version]}-%{+yyyy.MM.dd}"
编辑配置文件:
nano
、vim
或gedit
)打开配置文件。sudo nano /etc/filebeat/filebeat.yml
保存并退出:
重启Filebeat服务:
sudo systemctl restart filebeat
sudo filebeat test config
如果配置文件没有问题,该命令将输出Configuration is valid
。
通过以上步骤,你应该能够找到并修改Ubuntu系统中Filebeat的配置文件。