# Using ILM for Timeseries Data with a Static Write Index

**URL:** <https://discuss.elastic.co/t/using-ilm-for-timeseries-data-with-a-static-write-index/259023>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [December 17, 2020, 5:41pm UTC](https://discuss.elastic.co/t/using-ilm-for-timeseries-data-with-a-static-write-index/259023 "2020-12-17T17:41:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karl\_Falconer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karl_falconer/32/74795_2.png) [@Karl\_Falconer](https://discuss.elastic.co/u/Karl_Falconer)\
**Post date:** [December 17, 2020, 5:41pm UTC](https://discuss.elastic.co/t/using-ilm-for-timeseries-data-with-a-static-write-index/259023/1 "2020-12-17T17:41:26Z")

</div>

We are using a Ruby wrapper library called Searchkick which provides great functionality for searching within our application environment. However it is not great with managing Timeseries data.

Our objective is to be able to use ILM and a Hot/Cold architecture to better manage resources. Currently the library will write data into a single index and it will just grow forever. We have a temporary solution of running a `_delete_by_query` to purge records within the given index older than 30 days.

The library code executes searches against a single named index: `foo_production_<timestamp>`. The only time this index name would change is if for some reason we needed to reindex all of the data from source.(this does not happen often)

My question is, is there a way to implement a rollover strategy without making application/library code changes?

Are we able to implement an ILM policy such that the original index name always remains writeable, and we can maintain the ability to search across the newly created index. In other words can we create an alias with the same name as an index? Does it make sense to convert to a datastream? How would that impact searching?

If we can not get around making some application level change, is there documentation on how to implement the client side logic of index creation to support ILM on the server?

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [December 17, 2020, 7:27pm UTC](https://discuss.elastic.co/t/using-ilm-for-timeseries-data-with-a-static-write-index/259023/2 "2020-12-17T19:27:43Z")

</div>

I think you could create an alias to a new `foo_production_<timestamp>` and initialize the first index `foo_production_<timestamp>.000001`, which would initially be is\_write\_index: true.

To an application, an alias is an index, it can't tell. The alias points to all `foo_production_<timestamp>.00xxxx`, so queries work. Rollover moves the is\_write\_index to each new index as it's created.

I'm not sure if you would have to reindex, or if you could add the new alias to the old index.

---

<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:** [January 14, 2021, 7:27pm UTC](https://discuss.elastic.co/t/using-ilm-for-timeseries-data-with-a-static-write-index/259023/3 "2021-01-14T19:27:47Z")

</div>

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