# Create per frame index

**URL:** <https://discuss.elastic.co/t/create-per-frame-index/44492>\
**Category:** Elasticsearch\
**Created:** [March 15, 2016, 9:07pm UTC](https://discuss.elastic.co/t/create-per-frame-index/44492 "2016-03-15T21:07:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorge](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jorge](https://discuss.elastic.co/u/Jorge)\
**Post date:** [March 15, 2016, 9:07pm UTC](https://discuss.elastic.co/t/create-per-frame-index/44492/1 "2016-03-15T21:07:10Z")

</div>

Hello, how to make a template for the automatic creation of indexes . For example, if the index is called test , I want an automatic index was created with the name test- 03.15.2016 . If anyone can help me with a simple example and explain it, I appreciate it.

---

<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:** [March 16, 2016, 3:08am UTC](https://discuss.elastic.co/t/create-per-frame-index/44492/2 "2016-03-16T03:08:23Z")

</div>

You can't request an index called `test` and have it renamed to `test-$DATE`, you need to ask for the latter.

---

<div class="post-metadata">

**Author:** ![Jorge](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jorge](https://discuss.elastic.co/u/Jorge)\
**Post date:** [March 16, 2016, 11:15pm UTC](https://discuss.elastic.co/t/create-per-frame-index/44492/3 "2016-03-16T23:15:59Z")

</div>

Apologies , I think that I could not explain myself well . What I need is to create an index that automatically every day make the index name- yyy - mm -dd form . Just as it does when creating their indices logstash.

I do not know if I need to do , I could do with a template ?

---

<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:** [March 17, 2016, 3:41am UTC](https://discuss.elastic.co/t/create-per-frame-index/44492/4 "2016-03-17T03:41:52Z")

</div>

Right, then yes a template can do that.  
Check the `_templates` API endpoint and you can copy the existing Logstash one.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 17, 2016, 7:43am UTC](https://discuss.elastic.co/t/create-per-frame-index/44492/5 "2016-03-17T07:43:59Z")

</div>

As mark suggested you can create a template that will apply e.g. to all indices that start with 'test'. Whenever an index with a name matching this pattern is created, the mapping will be automatically applied. Logstash does this for indices starting with 'logstash' by default. This does by itself not create any indices though.

When Logstash writes a document, it looks at the timestamp (if time-based indices are used) and determines the full name of the index to write to, e.g. 'test-2016.03.17'. When this record is indexed into Elasticsearch the index is automatically created if it does not already exist.

---

<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 5, 2017, 11:07pm UTC](https://discuss.elastic.co/t/create-per-frame-index/44492/6 "2017-07-05T23:07:37Z")

</div>


