gpt4 book ai didi

logstash - 无法读取管道 yaml 文件

转载 作者:行者123 更新时间:2023-12-02 00:09:57 24 4
gpt4 key购买 nike

这是我关于 pipelines.yml 文件的问题。首先,我使用 Elasticsearch 6.6 和 Logstash 6.2.2。两者都安装在我自己的 Google Cloud 帐户中的虚拟机中(不是 ELK 提供的,而是在我自己的 GCP 帐户中托管的)。我有 3 个文件夹,来自 IoT 设备的日志文件来自这些文件夹,我只想将它们同时注入(inject)到 3 个相应的索引中,所以我在 logstash/config 路径中​​创建了一个 pipelines.yml 文件,其内容如下:

-pipeline.id: pipeline1
path.config: "/config/p1/logstash-learning.conf"
pipeline.workers: 1
-pipeline.id: pipeline2
path.config: "/config/p2/logstash-groundtruth.conf"
pipeline.workers: 1
-pipeline.id: pipeline3
path.config: "/config/p3/logstash-fieldtest.conf"
pipeline.workers: 1

因此,当我使用命令 ./bin/logstash 运行 logstash 时(使用此命令我们告诉 Logstash 加载默认文件 pipelines.yml,对吗?),我收到下面的错误消息,我无法弄清楚为什么会这样发生。请注意,pipelines.yml 具有完整的可访问性权限。

jruby: warning: unknown property jruby.regexp.interruptible
Sending Logstash's logs to /home/evangelos/logstash-6.2.2/logs which is now configured via log4j2.properties
[2019-12-17T16:36:43,877][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"/home/evangelos/logstash-6.2.2/modules/netflow/configuration"}
[2019-12-17T16:36:43,933][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"/home/evangelos/logstash-6.2.2/modules/fb_apache/configuration"}
ERROR: Failed to read pipelines yaml file. Location: /home/evangelos/logstash-6.2.2/config/pipelines.yml
usage:
bin/logstash -f CONFIG_PATH [-t] [-r] [] [-w COUNT] [-l LOG]
bin/logstash --modules MODULE_NAME [-M "MODULE_NAME.var.PLUGIN_TYPE.PLUGIN_NAME.VARIABLE_NAME=VALUE"] [-t] [-w COUNT] [-l LOG]
bin/logstash -e CONFIG_STR [-t] [--log.level fatal|error|warn|info|debug|trace] [-w COUNT] [-l LOG]
bin/logstash -i SHELL [--log.level fatal|error|warn|info|debug|trace]
bin/logstash -V [--log.level fatal|error|warn|info|debug|trace]
bin/logstash --help
[2019-12-17T16:36:45,347][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: org.jruby.exceptions.RaiseException: (SystemExit) exit

最佳答案

最后,使用http://www.yamllint.com/在线 yaml 测试人员认为 pipelines.yml 的正确语法如下:

-
pipeline.id: pipeline1
path.config: "/config/p1/logstash-learning.conf"
pipeline.workers: 1

-
pipeline.id: pipeline2
path.config: "/config/p2/logstash-groundtruth.conf"
pipeline.workers: 1

-
pipeline.id: pipeline3
path.config: "/config/p3/logstash-fieldtest.conf"
pipeline.workers: 1

关于logstash - 无法读取管道 yaml 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59378818/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com