简体   繁体   中英

Logstash Config Error

I am new to the ELK stack. Wanted to push data using a pipeline from filebeat to logstash, that'll push data to elastic. My configuration is as below:

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" ]
}

The issue is when I do a bin/logstash -f first-pipeline.conf --config.test_and_exit . It throws me an error stating:

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" ]
}

Can Anyone point out where am I going wrong?

You're missing a closing curly brace in your elasticsearch output

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM