# How to get daily new index?

**URL:** <https://discuss.elastic.co/t/how-to-get-daily-new-index/179496>\
**Category:** Elasticsearch\
**Created:** [May 3, 2019, 8:25am UTC](https://discuss.elastic.co/t/how-to-get-daily-new-index/179496 "2019-05-03T08:25:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![frankm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frankm/32/43658_2.png) [@frankm](https://discuss.elastic.co/u/frankm)\
**Post date:** [May 3, 2019, 8:25am UTC](https://discuss.elastic.co/t/how-to-get-daily-new-index/179496/1 "2019-05-03T08:25:49Z")

</div>

Hi,  
for my Index I would like to get every day a new one _name\_date_ like _my\_index\_190503_. With Logstast it works out of the box. But how to realize it with a own index? Can I create a index out of my C# -code? Or is it possible via template? And how to do it?  
Would be great to get some support.  
Thanks.

Here my index:

```
PUT time_series
{
  "settings": {
    "number_of_shards": 5
  },
  "mappings": {
    "timeseries": {
      "properties": {
                "timestamp" : { 
                  "type" : "date",
                  "format": "MM/dd/yyyy HH:mm:ss"
                  },
                "value" : { "type" : "double" },
                "recordid" : { "type" : "integer" }
      }
    }
  }
}
```

---

<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:** [May 6, 2019, 8:10am UTC](https://discuss.elastic.co/t/how-to-get-daily-new-index/179496/2 "2019-05-06T08:10:32Z")

</div>

Hey

see the [date math support in index name](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/date-math-index-names.html)

--Alex

---

<div class="post-metadata">

**Author:** ![frankm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frankm/32/43658_2.png) [@frankm](https://discuss.elastic.co/u/frankm)\
**Post date:** [May 6, 2019, 8:42am UTC](https://discuss.elastic.co/t/how-to-get-daily-new-index/179496/3 "2019-05-06T08:42:58Z")

</div>

Thanks Alex! 🙂

---

<div class="post-metadata">

**Author:** ![frankm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frankm/32/43658_2.png) [@frankm](https://discuss.elastic.co/u/frankm)\
**Post date:** [May 8, 2019, 1:11pm UTC](https://discuss.elastic.co/t/how-to-get-daily-new-index/179496/4 "2019-05-08T13:11:31Z")

</div>

Right now I just give the new index name including date to the client and the index is created automatically.  
[https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/indexing-documents.html#\_single\_documents\_with\_parameters](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/indexing-documents.html#_single_documents_with_parameters)  
Now I have only the problem to set the right types for the values.

---

<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:** [June 5, 2019, 1:11pm UTC](https://discuss.elastic.co/t/how-to-get-daily-new-index/179496/5 "2019-06-05T13:11:42Z")

</div>

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