# How to set mapping to run on a daily basis?

**URL:** <https://discuss.elastic.co/t/how-to-set-mapping-to-run-on-a-daily-basis/250391>\
**Category:** Kibana\
**Created:** [September 29, 2020, 3:37pm UTC](https://discuss.elastic.co/t/how-to-set-mapping-to-run-on-a-daily-basis/250391 "2020-09-29T15:37:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kercio](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@kercio](https://discuss.elastic.co/u/kercio)\
**Post date:** [September 29, 2020, 3:37pm UTC](https://discuss.elastic.co/t/how-to-set-mapping-to-run-on-a-daily-basis/250391/1 "2020-09-29T15:37:08Z")

</div>

My script sends data to Kibana on a daily basis on this format "xxxx-flat-2020-09-21"  
I created an index pattern "xxxx-flat-\*" which is working almost fine.  
For each index I need to run this mapping below, otherwise, the 'UploadTimestamp' field, which has data type text by default, will display a data type conflict error.  
Is there a way to configure in Kibana to perform this mapping on a daily basis automatically?

PUT /xxxx-flat-2020-09-21/hostinfo/\_mapping  
{  
"properties": {  
"UploadTimestamp": {  
"type": "date"  
}  
}  
}

---

<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:** [September 29, 2020, 6:15pm UTC](https://discuss.elastic.co/t/how-to-set-mapping-to-run-on-a-daily-basis/250391/2 "2020-09-29T18:15:33Z")

</div>

Use an [index template](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html)

A template that matches indices named "xxxx-flat-\*" would be used at index creation to apply that mapping.

---

<div class="post-metadata">

**Author:** ![kercio](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@kercio](https://discuss.elastic.co/u/kercio)\
**Post date:** [September 29, 2020, 7:56pm UTC](https://discuss.elastic.co/t/how-to-set-mapping-to-run-on-a-daily-basis/250391/3 "2020-09-29T19:56:07Z")

</div>

Your suggestion resolved the issue. Thanks @rugenl

---

<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:** [October 27, 2020, 7:56pm UTC](https://discuss.elastic.co/t/how-to-set-mapping-to-run-on-a-daily-basis/250391/4 "2020-10-27T19:56:09Z")

</div>

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