# How to create daily rotation index with python-elasticsearch

**URL:** <https://discuss.elastic.co/t/how-to-create-daily-rotation-index-with-python-elasticsearch/96113>\
**Category:** Elasticsearch\
**Created:** [August 7, 2017, 1:31pm UTC](https://discuss.elastic.co/t/how-to-create-daily-rotation-index-with-python-elasticsearch/96113 "2017-08-07T13:31:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JiGe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jige/32/42412_2.png) [@JiGe](https://discuss.elastic.co/u/JiGe)\
**Post date:** [August 7, 2017, 1:31pm UTC](https://discuss.elastic.co/t/how-to-create-daily-rotation-index-with-python-elasticsearch/96113/1 "2017-08-07T13:31:01Z")

</div>

Just like logstash index, which could be rotated daily automatically.  
How to achieve this with python-elasticsearch?  
create daily rotation index and search from the index.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 7, 2017, 1:56pm UTC](https://discuss.elastic.co/t/how-to-create-daily-rotation-index-with-python-elasticsearch/96113/2 "2017-08-07T13:56:37Z")

</div>

no need to add any logic in your python code, just use [index name datemath](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/date-math-index-names.html)

---

<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:** [September 4, 2017, 1:57pm UTC](https://discuss.elastic.co/t/how-to-create-daily-rotation-index-with-python-elasticsearch/96113/3 "2017-09-04T13:57:09Z")

</div>

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