The given configuration is invalid. Reason: Expected one of #

Hi all,

I am following this link (Link) to display live weather data on Kibana.

I used the logstash configuration explained in the pdf.

Here is my logstash configuration

input {
  exec {
    command => "curl --silent -L ’"API_KEY"&units=metric’"
    codec => "json"
    interval => 600
filter {
  mutate {
    remove field => ["@version" ,"command" ,"host" ,"cod" ,"id" ,"base" ,"coord" ,"sys" ,"dt"]
  split { field => "weather" }
output {
  elasticsearch {
    hosts => ["localhost:9200"]
    index => "weather-%{+YYYY.MM.dd}"

When I execute the command

.\logstash -f weather_data.conf --config.test_and_exit

I get an error that reads like this

Sending Logstash's logs to E:/elk/logstash/logs which is now configured via
[2018-07-17T15:28:42,202][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2018-07-17T15:28:42,976][FATAL][logstash.runner          ] The given configuration is invalid. Reason: Expected one of #, => at line 10, column 12 (byte 241) after filter {
  mutate {
[2018-07-17T15:28:42,995][ERROR][org.logstash.Logstash    ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

What's wrong with the configuration? Request to please help me out here. Thanks in advance!

should be remove_field


Seems like logstash is running

Successfully started Logstash API endpoint {:port=>9600}

But, I don't see a new index in Elasticsearch

On the browser, I navigated to


This is the output I got,

What do I have to do now? I don't see any index that begins with weather-*.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.