在 filebeat 中使用 -E 选项从命令行动态输入路径

Dynamic inputs path from command line using -E Option in filebeat

之前,我使用过 filebeat 5.4.0 并且能够通过像这样修改 install-service-filebeat 脚本来动态设置 filebeat 输入路径,并且工作正常。

新服务-name filebeat -displayName filebeat -binaryPathName ""$workdir\filebeat.exe" -c "$workdir\filebeat.yml" -E "filebeat.prospectors.0.paths=["$filebeat_input_path"]" -path.home "$workdir" - path.data "$workdir""

现在,我们打算升级到最新的ELK stack(v6.5.2),上面的配置好像不行。

注意:我曾尝试将 'filebeat.prospectors.0.paths' 更改为 'filebeat.inputs.0.paths',但没有用。

终于能够通过使用具有以下 filebeat 配置的 filebeat 版本 6.5.2 来解决问题

filebeat.exe" -c "filebeat.yml" -E "filebeat.inputs.0.paths= ["D:\logs\server*.log","D:\service\logs*.log"]"