这是我关于 pipelines.yml 文件的问题。首先,我使用 Elasticsearch 6.6 和 Logstash 6.2.2。两者都安装在我自己的 Google Cloud 帐户的虚拟机中(不是 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
Run Code Online (Sandbox Code Playgroud)
因此,当我使用命令 ./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
Run Code Online (Sandbox Code Playgroud)
最后,使用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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8085 次 |
| 最近记录: |