为什么使用 -c 参数后,filebeat 仍加载 /etc 中的 filebeat.yml?
在安装 filebeat 之后(不是在 docker 中运行),用户遇到一个问题:尽管指定了 -c 参数和自定义的 filebeat.yml 配置文件,但 filebeat 仍然尝试加载 etc 目录中的默认配置文件。
问题解决:
问题的原因在于 global flags 和 directory layout 的交互。
由于未指定 path.config,因此 filebeat 默认为 /etc/filebeat 为配置文件路径。因此,即使使用 -c 参数指定了自定义配置文件,filebeat 仍然尝试加载 /etc/filebeat/filebeat.yml。
解决方案:
要解决此问题,用户可以指定 path.config 的显式值以指向自定义配置文件的目录:
filebeat -c ./filebeat.yml --path.config=/home/bot/Desktop/coder/ideaboom/test_ELK_EFK
通过明确指定 path.config,filebeat 将仅尝试加载指定目录中的 filebeat.yml,解决配置加载问题。
以上就是为什么使用 -c 参数后,filebeat 仍然优先加载 /etc/filebeat.yml?的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号