【问题标题】:Logstash Config ErrorLogstash 配置错误
【发布时间】:2017-08-29 20:08:03
【问题描述】:

我是 ELK 堆栈的新手。想要使用从 filebeat 到 logstash 的管道推送数据,这会将数据推送到弹性。我的配置如下:

input {
beats {
    port => "5043"
  }
}

filter {
  grok {
match => { "message" => "\A%{TIMESTAMP_ISO8601:timestamp}%{SPACE}%{WORD:var0}%{SPACE}%{NOTSPACE}%{SPACE}(?<searchinfo>[^#]*)#(?<username>[^#]*)#(?<searchQuery>[^#]*)#(?<latitude>[^#]*)#(?<longitude>[^#]*)#(?<client_ip>[^#]*)#(?<responseTime>[^#]*)" }
  }
}


output {
     stdout { codec => rubydebug }
        elasticsearch {
            index => "logstash_logs"
            document_type => "logs"
            hosts => [ "localhost:9200" ]
}

问题是当我执行bin/logstash -f first-pipeline.conf --config.test_and_exit 时。它给我一个错误说明:

17:55:37.691 [LogStash::Runner] FATAL logstash.runner - The given configuration is invalid. Reason: Expected one of #, if, ", ', } at line 22, column 1 (byte 487) after output {
stdout { codec => rubydebug }
    elasticsearch {
        index => "logstash_logs"
        document_type => "logs"
        hosts => [ "localhost:9200" ]
}

谁能指出我哪里出错了?

【问题讨论】:

    标签: elasticsearch logstash kibana filebeat


    【解决方案1】:

    elasticsearch 输出中缺少右花括号

    output {
      stdout { codec => rubydebug }
      elasticsearch {
         index => "logstash_logs"
         document_type => "logs"
         hosts => [ "localhost:9200" ]
      }     <--- this is missing
    }
    

    【讨论】:

    • 大声笑,这一定是最愚蠢的事情。我不敢相信我错过了。谢谢。现在可以使用了。
    • 有时,它就在你面前 :-) 很高兴它现在可以工作了
    猜你喜欢
    • 2016-12-28
    • 1970-01-01
    • 2020-01-19
    • 1970-01-01
    • 1970-01-01
    • 2020-01-27
    • 1970-01-01
    • 2015-05-30
    • 1970-01-01
    相关资源
    最近更新 更多