在 pipelines.yml 中使用 path.config 时启动 logstash 时出错

Error Starting logstash When Using path.config in pipelines.yml

我有一个使用单个管道定义的非常简单的 pipelines.yml 文件。它看起来像这样:

- pipeline.id: testPipe1
path.config: "/tmp/test.conf"
pipeline.workers: 1

启动 logstash 时,我收到以下错误:

错误:无法读取管道 yaml 文件。位置 [文件路径].pipelines.yml

,其中 "path to file" 是 yaml 文件的有效路径。

test.conf的内容是:

input { stdin {} } output { stout {codec => rubydebug} }

当我注释掉 path.config 行并使用时:

config.string: input { stdin {} } output { stout {codec => rubydebug} }

,然后 logstash 创建管道并正常启动。

这是怎么回事?感谢任何见解。谢谢

您的 pipelines.yml 文件应放在“--path.settings”,您将在启动 logstash 进程时在命令行上传递该文件。类似于:

./bin/logstash --path.settings /path_to_your_settings_dir_containing_your_configs_and_pipelines.yml

需要注意的一件事是管道(扩展名为 .conf)被视为 config。设置(带有 .yml)扩展名是您的 设置。我会将它们分成两个不同的目录,然后 运行 命令行 this.

./bin/logstash --path.settings /path_to_your_yml_settings_dir --path.config=/path_to_your_conf_pipelines