Logstash 在pipelines.yml中使用path.config时启动日志存储时出错

Logstash 在pipelines.yml中使用path.config时启动日志存储时出错,logstash,elastic-stack,Logstash,Elastic Stack,我有一个非常简单的pipelines.yml文件,它是用一个管道定义的。看起来是这样的: - pipeline.id: testPipe1 path.config: "/tmp/test.conf" pipeline.workers: 1 启动logstash时,我收到以下错误: 错误:读取yaml文件失败。位置[文件路径].pipelines.yml ,其中“文件路径”是yaml文件的有效路径 test.conf的内容包括: input { stdin {} } output { stout

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

- pipeline.id: testPipe1
path.config: "/tmp/test.conf"
pipeline.workers: 1
启动logstash时,我收到以下错误:

错误:读取yaml文件失败。位置[文件路径].pipelines.yml

,其中“文件路径”是yaml文件的有效路径

test.conf的内容包括:

input { stdin {} } output { stout {codec => rubydebug} }
当我注释掉path.config行并使用:

config.string: input { stdin {} } output { stout {codec => rubydebug} }
,然后logstash创建管道并正常启动


这是怎么回事?感谢您的见解。谢谢

您的pipelines.yml文件应该放在“-path.settings”中,您可以在启动日志存储过程时通过命令行传递该文件。比如:

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

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

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

感谢Furhan S。但是,我的问题是pipelines.yml中的path.config。如上所述,当我将管道的配置与config.string对齐时,logstash运行良好。配置文件的路径包含在pipeline.yml中,在--Path.settings中查找。很抱歉,我不理解您的意思。当我启动logstash时,我已经有了path.settings命令行选项。我将路径放在config目录下。该配置目录包含pipelines.yml和每个管道的单独配置文件。它会找到pipelines.yml文件,因为当我使用config.string而不是path.config时,logstash可以正常工作。我是不清楚还是误解了你?谢谢Samuurai我做到了。谢谢。也谢谢你,富汉S。