Logstash 无法读取yaml文件

Logstash 无法读取yaml文件,logstash,pipeline,Logstash,Pipeline,这是我关于pipelines.yml文件的问题。首先,我使用Elasticsearch 6.6和Logstash 6.2.2。两者都安装在我自己的谷歌云账户的虚拟机中(不是ELK提供的,而是我自己的GCP账户中的主机)。我有3个文件夹,其中有来自IoT设备的日志文件,我只想在3个相应的索引中同时输入它们,因此我在logstash/config路径中创建了一个pipelines.yml文件,包含以下内容: -pipeline.id: pipeline1 path.config: "/config

这是我关于pipelines.yml文件的问题。首先,我使用Elasticsearch 6.6和Logstash 6.2.2。两者都安装在我自己的谷歌云账户的虚拟机中(不是ELK提供的,而是我自己的GCP账户中的主机)。我有3个文件夹,其中有来自IoT设备的日志文件,我只想在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

您是否更改了path.config中的路径

-pipeline.id: pipeline1
 path.config: "/home/evangelos/logstash-6.2.2/pipelines/logstash-learning.conf"
 pipeline.workers: 1
-pipeline.id: pipeline2
 path.config: "/home/evangelos/logstash-6.2.2/pipelines/logstash-groundtruth.conf"
 pipeline.workers: 1
-pipeline.id: pipeline3
 path.config: "/home/evangelos/logstash-6.2.2/pipelines/logstash-fieldtest.conf"
 pipeline.workers: 1
在pipelines.yml文件中进行上述设置后, 运行以下命令以运行管道

bin/logstash --path.settings config/

请保持每条管道之间的空间线如下所示

-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
最后,通过使用在线yaml tester,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的?您是否在文件系统的根目录中有一个名为
/config
的目录以及管道配置,或者您的配置在
/home/evangelos/logstash-6.2.2/config/
目录中?我的日志存储在路径:/home/evangelos/logstash-6.2.2/bin和3个配置文件(管道)中在路径:/home/evangelos/logstash-6.2.2/config的三个子文件夹中:/b1、/b2、/b3。在配置路径:/home/evangelos/logstash-6.2.2/folderName之外创建一个单独的文件夹,并移动此文件夹中的所有三个conf文件。@Angel H,我在:/home/evangelos/logstash-6.2.2/pipelines中的配置路径外创建了一个单独的文件夹,并移动了该文件夹中的所有三个conf文件,但每当我使用命令调用logstash:./bin/logstash时,相同的错误就会持续存在。在我看来(根据我收到的错误消息),logstash成功地找到了pipelines.yml文件,但未能打开它,我不知道为什么。此文件的权限如下所示。有什么问题吗?我也要和logstash.yml做点什么吗-rwxr-xr-x 1 root根402 Dec 18 09:39 pipelines.yml*我做了,但没有任何变化。我仍然收到相同的错误消息。是的,我做了您在path.config中所说的更改,但错误仍然存在。