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

**URL:** <https://discuss.elastic.co/t/the-given-configuration-is-invalid-reason-expected-one-of/140407>\
**Category:** Logstash\
**Created:** [July 17, 2018, 10:36pm UTC](https://discuss.elastic.co/t/the-given-configuration-is-invalid-reason-expected-one-of/140407 "2018-07-17T22:36:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![APJ](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@APJ](https://discuss.elastic.co/u/APJ)\
**Post date:** [July 17, 2018, 10:36pm UTC](https://discuss.elastic.co/t/the-given-configuration-is-invalid-reason-expected-one-of/140407/1 "2018-07-17T22:36:17Z")

</div>

Hi all,

I am following this link ([Link](https://www.researchgate.net/publication/319243453_Building_an_IoT_Data_Hub_with_Elasticsearch_Logstash_and_Kibana)) 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 ’http://api.openweathermap.org/data/2.5/weather?id=5490223&APPID="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 log4j2.properties
[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 {
    remove
[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!

---

<div class="post-metadata">

**Author:** ![mikebd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikebd/32/33437_2.png) [@mikebd](https://discuss.elastic.co/u/mikebd)\
**Post date:** [July 17, 2018, 10:40pm UTC](https://discuss.elastic.co/t/the-given-configuration-is-invalid-reason-expected-one-of/140407/2 "2018-07-17T22:40:23Z")

</div>

> [@APJ](#):
>
> remove field

should be `remove_field`

---

<div class="post-metadata">

**Author:** ![APJ](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@APJ](https://discuss.elastic.co/u/APJ)\
**Post date:** [July 17, 2018, 10:51pm UTC](https://discuss.elastic.co/t/the-given-configuration-is-invalid-reason-expected-one-of/140407/3 "2018-07-17T22:51:02Z")

</div>

Thanks!

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

> [http://localhost:9200/\_cat/indices](http://localhost:9200/_cat/indices)

This is the output I got,

 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/1/b/1b2d2972ff64c2f21c9108a3ccab2d4d16ad1a84.PNG)

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 14, 2018, 10:51pm UTC](https://discuss.elastic.co/t/the-given-configuration-is-invalid-reason-expected-one-of/140407/4 "2018-08-14T22:51:06Z")

</div>

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