# Rollover index daily

**URL:** <https://discuss.elastic.co/t/rollover-index-daily/86062>\
**Category:** Elasticsearch\
**Created:** [May 17, 2017, 7:54am UTC](https://discuss.elastic.co/t/rollover-index-daily/86062 "2017-05-17T07:54:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bouboune](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@bouboune](https://discuss.elastic.co/u/bouboune)\
**Post date:** [May 17, 2017, 7:54am UTC](https://discuss.elastic.co/t/rollover-index-daily/86062/1 "2017-05-17T07:54:35Z")

</div>

Hello,

There is something that is still unclear for me about rollover index. What i understood is, If i set the indice to rollover each day, each day i have a new index:

day 1 ===\> logs-2017.05.17-1  
day 2 ===\> logs-2017.05.18-000001  
day 3 ===\> logs-2017.05.19-000001  
...

But When i did my test it rollover only once:

day 1 ===\> logs-2017.05.13-1  
day 2 ===\> logs-2017.05.14-000001

Does Elasticsearch rollover index automatically each time the rollover condition is true or it only do it once ?

---

<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:** [May 17, 2017, 9:36am UTC](https://discuss.elastic.co/t/rollover-index-daily/86062/2 "2017-05-17T09:36:49Z")

</div>

Depends how you set it up, so what did you send to ES?

---

<div class="post-metadata">

**Author:** ![bouboune](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@bouboune](https://discuss.elastic.co/u/bouboune)\
**Post date:** [May 17, 2017, 10:13am UTC](https://discuss.elastic.co/t/rollover-index-daily/86062/3 "2017-05-17T10:13:15Z")

</div>

Thank's for your response, I did :

```
PUT _template/logs
{
  "template": "logs-*",
  "settings": {
    "number_of_shards": 5,
    "number_of_replicas": 0
  },
  "aliases": {
    "active-logs": {}
  }
}

POST active-logs/log
{ "text": "Some log message", "@timestamp": "2016-07-05T01:00:00Z" }

POST active-logs/_rollover
{
  "conditions": {
    "max_age": "1d"
  }
}
```

---

<div class="post-metadata">

**Author:** ![ESCoder](https://avatars.discourse-cdn.com/v4/letter/e/9e8a1a/32.png) [@ESCoder](https://discuss.elastic.co/u/ESCoder)\
**Post date:** [June 9, 2017, 7:49pm UTC](https://discuss.elastic.co/t/rollover-index-daily/86062/4 "2017-06-09T19:49:46Z")

</div>

@bouboune:

You have to set a cron job to run the POST active-logs/rollover call periodically to check if the conditions are met.

when the condition becomes true, it will rollover.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [June 10, 2017, 8:34am UTC](https://discuss.elastic.co/t/rollover-index-daily/86062/5 "2017-06-10T08:34:20Z")

</div>

[Curator](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.1/rollover.html) supports the Rollover API

---

<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 8, 2017, 8:34am UTC](https://discuss.elastic.co/t/rollover-index-daily/86062/6 "2017-07-08T08:34:26Z")

</div>

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