# Unable to create index in elasticsearch

**URL:** https://discuss.elastic.co/t/unable-to-create-index-in-elasticsearch/140615
**Category:** Logstash
**Created:** [July 18, 2018, 7:37pm UTC](https://discuss.elastic.co/t/unable-to-create-index-in-elasticsearch/140615 "2018-07-18T19:37:29Z")
**Posts on this page:** 5
**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 18, 2018, 7:37pm UTC](https://discuss.elastic.co/t/unable-to-create-index-in-elasticsearch/140615/1 "2018-07-18T19:37:30Z")

</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=MY_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}"
  }
  stdout {
    codec => rubydebug
  }
}

```

After I start logstash, I checked the log file **logstash-plain.log**

```
[2018-07-18T11:18:18,301][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2018-07-18T11:18:18,764][INFO][logstash.runner] Starting Logstash {"logstash.version"=>"6.3.1"}
[2018-07-18T11:18:22,501][INFO][logstash.pipeline] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>8, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50}
[2018-07-18T11:18:22,879][INFO][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://localhost:9200/]}}
[2018-07-18T11:18:22,886][INFO][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://localhost:9200/, :path=>"/"}
[2018-07-18T11:18:23,089][WARN][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>"http://localhost:9200/"}
[2018-07-18T11:18:23,168][INFO][logstash.outputs.elasticsearch] ES Output version determined {:es_version=>6}
[2018-07-18T11:18:23,177][WARN][logstash.outputs.elasticsearch] Detected a 6.x and above cluster: the `type` event field won't be used to determine the document _type {:es_version=>6}
[2018-07-18T11:18:23,213][INFO][logstash.outputs.elasticsearch] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["//localhost:9200"]}
[2018-07-18T11:18:23,252][INFO][logstash.outputs.elasticsearch] Using mapping template from {:path=>nil}
[2018-07-18T11:18:23,297][INFO][logstash.outputs.elasticsearch] Attempting to install template {:manage_template=>{"template"=>"logstash-*", "version"=>60001, "settings"=>{"index.refresh_interval"=>"5s"}, "mappings"=>{"_default_"=>{"dynamic_templates"=>[{"message_field"=>{"path_match"=>"message", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false}}}, {"string_fields"=>{"match"=>"*", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false, "fields"=>{"keyword"=>{"type"=>"keyword", "ignore_above"=>256}}}}}], "properties"=>{"@timestamp"=>{"type"=>"date"}, "@version"=>{"type"=>"keyword"}, "geoip"=>{"dynamic"=>true, "properties"=>{"ip"=>{"type"=>"ip"}, "location"=>{"type"=>"geo_point"}, "latitude"=>{"type"=>"half_float"}, "longitude"=>{"type"=>"half_float"}}}}}}}}
[2018-07-18T11:18:23,369][INFO][logstash.inputs.exec] Registering Exec Input {:type=>nil, :command=>"curl --silent -L \"http://api.openweathermap.org/data/2.5/weather?id=5490223&appid='My_API_Key'&units=metric\"", :interval=>600, :schedule=>nil}
[2018-07-18T11:18:23,409][INFO][logstash.pipeline] Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x7420a8b0 run>"}
[2018-07-18T11:18:23,552][INFO][logstash.agent] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2018-07-18T11:18:24,086][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9600}

```

As per my understanding, it seems to be running fine, but, I don't see any index beginning with **weather-** \*, created in elasticsearch.

```
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open .kibana ZB7x3FQyQlyRvkRIaEGi2g 1 0 2 0 12.3kb 12.3kb
green open .monitoring-kibana-6-2018.07.12 8iFI69JhQL-bLWsGZzFQYA 1 0 2370 0 697.8kb 697.8kb
green open .monitoring-es-6-2018.07.12 4-XcOMWsRkW7_enzqslTQg 1 0 34226 115 12.7mb 12.7mb
yellow open logstash-2018.07.13 _oiQOnpMQ4KQcHssK8PmxA 5 1 9999 0 7mb 7mb
green open .monitoring-es-6-2018.07.18 h_ylFE80RS6153Sx5A7o6A 1 0 11538 0 11mb 11mb
green open .monitoring-es-6-2018.07.15 27pTcx8TTDqchfQgo7WQ-w 1 0 234 0 160.2kb 160.2kb
green open .monitoring-kibana-6-2018.07.16 Lmydu8eOS8-p6aKPP7SUqw 1 0 1383 0 465.1kb 465.1kb
green open .monitoring-es-6-2018.07.17 HThfGRdATO-C455Xm_-e9Q 1 0 49107 175 18.1mb 18.1mb
green open .monitoring-kibana-6-2018.07.17 u1EedigZSWeXOaOwdueEdQ 1 0 2450 0 700.7kb 700.7kb
green open .monitoring-kibana-6-2018.07.14 17TgPEalTAOJRe3gb59eZA 1 0 15 0 87.5kb 87.5kb
green open .monitoring-es-6-2018.07.16 3iZspMNoQUuty5lYM5ylvg 1 0 39028 135 17.3mb 17.3mb
green open .monitoring-es-6-2018.07.13 1FBGvkSzR4yf7WcyrwN3LQ 1 0 51214 50 19.2mb 19.2mb
green open .monitoring-kibana-6-2018.07.18 ZnYApUXKQbiH9CVFRqmzdw 1 0 530 0 413.1kb 413.1kb
green open .monitoring-kibana-6-2018.07.15 9TZ9csgUQp-LrAbRYT4aGw 1 0 9 0 127.5kb 127.5kb
green open .monitoring-kibana-6-2018.07.13 Cpt83ctnQiqLWiydy1nmUw 1 0 2585 0 830.1kb 830.1kb
green open .monitoring-es-6-2018.07.14 fuXHKIMNS5u15-XR0dvrTw 1 0 380 162 575.3kb 575.3kb

```

What wrong am I doing? Have I missed out on any steps that I should have followed?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [July 18, 2018, 8:55pm UTC](https://discuss.elastic.co/t/unable-to-create-index-in-elasticsearch/140615/2 "2018-07-18T20:55:42Z")

</div>

I would suggest you look at using the `http_poller` input rather than the `exec` one.

---

<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 18, 2018, 10:39pm UTC](https://discuss.elastic.co/t/unable-to-create-index-in-elasticsearch/140615/3 "2018-07-18T22:39:09Z")

</div>

Thanks a lot! I will take a look at it.

---

<div class="post-metadata">

### Author: ![rijinmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rijinmp/32/24634_2.png) [@rijinmp](https://discuss.elastic.co/u/rijinmp)
#### Post date: [July 22, 2018, 4:46pm UTC](https://discuss.elastic.co/t/unable-to-create-index-in-elasticsearch/140615/4 "2018-07-22T16:46:53Z")

</div>

Is it solved ? Can you show your logstash.yml file ?

---

<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 19, 2018, 4:47pm UTC](https://discuss.elastic.co/t/unable-to-create-index-in-elasticsearch/140615/5 "2018-08-19T16:47:04Z")

</div>

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