【问题标题】:Logstash start with error: Pipelines YAML file is emptyLogstash 以错误开始:管道 YAML 文件为空
【发布时间】:2018-12-14 13:21:01
【问题描述】:

当我尝试在我的机器上启动 logstash 服务器时,我收到了这个错误:

Sending Logstash's logs to D:/kibana/logstash-6.3.2/logs which is now configured
     via log4j2.properties
    ERROR: Pipelines YAML file is empty. Location: D:/kibana/logstash-6.3.2/config/p
    ipelines.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_NAM
    E.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
    [2018-12-14T16:16:10,809][ERROR][org.logstash.Logstash    ] java.lang.IllegalSta
    teException: Logstash stopped processing because of an error: (SystemExit) exit

我删除所有并提取新代码(默认配置)并得到这个错误。

【问题讨论】:

    标签: logstash logstash-configuration


    【解决方案1】:

    看起来您正在尝试使用多个管道配置启动 Logstash:

    当你不带参数启动 Logstash 时,它会读取 pipelines.yml 文件并实例化在 文件。另一方面,当您使用 -e 或 -f 时,Logstash 会忽略 pipelines.yml 文件并记录有关它的警告。

    您可以指定配置文件位置启动 Logstash:

    logstash -f mypipeline.conf
    

    或者您可以只配置您的pipelines.yml 文件。我强烈建议使用管道配置,因为将来扩展 Logstash 会更容易,并且您可以为每个管道指定资源。

    pipelines.yml的示例配置:

    - pipeline.id: my_pipeline_name
      path.config: "/path/to/your/config/file.cfg"
      queue.type: persisted
    

    【讨论】:

    • 但我遇到以下错误:- 无法执行操作 {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message =>“预期为 [ \\t\\r\\n], \"#\", \"input\", \"filter\", \"output\" 的第 1 行第 1 列之一(字节 1 )", :backtrace=>["C:/logstash/logstash-7.6.1/logstash-core/lib/logstash/compiler.rb:47:in
    【解决方案2】:

    如果最近使用brew 安装了logstash,请尝试前往

    cd /usr/local/logstash/{version-number}
    

    然后运行

    
    bin/logstash -f "/path/to/your/pipeline/config.conf" --config.reload.automatic
    
    brew service restart logstash
    

    来源:https://www.elastic.co/guide/en/logstash/current/advanced-pipeline.html

    【讨论】:

      猜你喜欢
      • 2019-08-23
      • 2020-03-21
      • 1970-01-01
      • 2020-08-05
      • 2020-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多