# Elasticsearch-river-kafka not creating daily indexes

**URL:** <https://discuss.elastic.co/t/elasticsearch-river-kafka-not-creating-daily-indexes/25273>\
**Category:** Elasticsearch\
**Created:** [July 10, 2015, 12:26am UTC](https://discuss.elastic.co/t/elasticsearch-river-kafka-not-creating-daily-indexes/25273 "2015-07-10T00:26:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nivinm](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@nivinm](https://discuss.elastic.co/u/nivinm)\
**Post date:** [July 10, 2015, 12:26am UTC](https://discuss.elastic.co/t/elasticsearch-river-kafka-not-creating-daily-indexes/25273/1 "2015-07-10T00:26:14Z")

</div>

Hello,

We are transferring data from logstash \> kafka \> elasticsearch-river-kafka \> elasticsearch || kibana. While this method works, we are noticing that daily indexes are not created. Is there a way to have daily indexes created while using the elasticsearch-river-kafka?

We are using the following river: [https://github.com/mariamhakobyan/elasticsearch-river-kafka](https://github.com/mariamhakobyan/elasticsearch-river-kafka)

Below are the steps we used:

```
1) Create the index
curl -XPUT 'http://elasticsearch.nvnnas.com:9200/test-app-prod-index/'

2) Create Timestamp mapping:
curl -XPUT 'http://elasticsearch.nvnnas.com:9200/test-app-prod-index/logs/_mapping' -d '{
"logs" : {
"properties" : {
"ts" : {"type" : "date", "index":"not_analyzed", "format": "yyyy-MM-dd HH:mm:ss.SSS"}
}
}
}'

3) Enable meta fields like timestamp and _ttl as follows:-
curl -XPUT 'http://elasticsearch.nvnnas.com:9200/test-app-prod-index/logs/_mapping' -d '
{
"logs" : {
"_timestamp" : { "enabled" : true,"type":"date", "format": "yyyy-MM-dd HH:mm:ss.SSS", "time_zone":"CST"},
"_ttl" : { "enabled" : true, "default" : "15d" }
}
}'

4) The last step – create the river and associate it with the index and type created in first two steps.
curl -XPUT 'elasticsearch.nvnnas.com:9200/_river/kafka-river-1/_meta' -d '
{
"type" : "kafka",
"kafka" : {
"zookeeper.connect" : "nvnkaf01v:2181,nvnkaf02v:2181,nvnkaf03v:2181", 
"zookeeper.connection.timeout.ms" : 10000,
"topic" : "test-app-prod",
"message.type" : "json"
},
"index" : {
"index" : "test-app-prod-index",
"type" : "logs",
"bulk.size" : 100,
"concurrent.requests" : 5,
"action.type" : "index"
}
}'
```

---

<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 10, 2015, 1:52am UTC](https://discuss.elastic.co/t/elasticsearch-river-kafka-not-creating-daily-indexes/25273/2 "2015-07-10T01:52:24Z")

</div>

Rivers are deprecated, you should move to using Logstash with the Kafka input.

---

<div class="post-metadata">

**Author:** ![nivinm](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@nivinm](https://discuss.elastic.co/u/nivinm)\
**Post date:** [July 10, 2015, 3:36am UTC](https://discuss.elastic.co/t/elasticsearch-river-kafka-not-creating-daily-indexes/25273/3 "2015-07-10T03:36:48Z")

</div>

Thanks Mark for your reply, we can go that route if needed. However I'm interested in finding out how to make daily indexes, if possible, with the river.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 10, 2015, 6:29am UTC](https://discuss.elastic.co/t/elasticsearch-river-kafka-not-creating-daily-indexes/25273/4 "2015-07-10T06:29:07Z")

</div>

I don't think you can.  
You could create a river instance per day using a CRON and remove the old one?

But as Mark said I would not work on that as you will throw away all your code with 2.0.

---

<div class="post-metadata">

**Author:** ![nivinm](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@nivinm](https://discuss.elastic.co/u/nivinm)\
**Post date:** [July 10, 2015, 7:28pm UTC](https://discuss.elastic.co/t/elasticsearch-river-kafka-not-creating-daily-indexes/25273/5 "2015-07-10T19:28:44Z")

</div>

Got it, thanks David and Mark!

---

<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:** [July 6, 2017, 12:02am UTC](https://discuss.elastic.co/t/elasticsearch-river-kafka-not-creating-daily-indexes/25273/6 "2017-07-06T00:02:16Z")

</div>


