# Elastic cloud APM server time based index template

**URL:** <https://discuss.elastic.co/t/elastic-cloud-apm-server-time-based-index-template/321076>\
**Category:** APM\
**Tags:** server\
**Created:** [December 13, 2022, 12:00am UTC](https://discuss.elastic.co/t/elastic-cloud-apm-server-time-based-index-template/321076 "2022-12-13T00:00:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ali\_Nazemian](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@Ali\_Nazemian](https://discuss.elastic.co/u/Ali_Nazemian)\
**Post date:** [December 13, 2022, 12:00am UTC](https://discuss.elastic.co/t/elastic-cloud-apm-server-time-based-index-template/321076/1 "2022-12-13T00:00:07Z")

</div>

I am running an Elastic cluster 7.17.x on Elastic cloud. I would like to switch to a time-based index template for my APM setup and cannot figure out how to do it. I am looking for a way to include a date in the index name pattern. For example, having apm-2022-12-13-xxx as the index name then every day a new one will be created according to ILM policy. I can see there are some instructions on how to do it for a self-hosted version but not sure how it can be done for a cloud version.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 13, 2022, 1:16am UTC](https://discuss.elastic.co/t/elastic-cloud-apm-server-time-based-index-template/321076/2 "2022-12-13T01:16:18Z")

</div>

You should be able to just go into the default policy `apm-rollover-30-days` and edit it to max age in hot to 1 day... that will create daily indices.

This is the simplest way

 ![Screen Shot 2022-12-12 at 5.14.19 PM](https://us1.discourse-cdn.com/elastic/original/3X/1/f/1f63ab69e4953134388a3d183bc3fd5bcb1c0c8d.jpeg)

---

<div class="post-metadata">

**Author:** ![Ali\_Nazemian](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@Ali\_Nazemian](https://discuss.elastic.co/u/Ali_Nazemian)\
**Post date:** [December 13, 2022, 1:56am UTC](https://discuss.elastic.co/t/elastic-cloud-apm-server-time-based-index-template/321076/3 "2022-12-13T01:56:25Z")

</div>

Thanks @stephenb . Sorry, what I meant was using the date (e.g. YYYY-MM-DD) in the index name. I will update the question to make it more clear.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 13, 2022, 2:21am UTC](https://discuss.elastic.co/t/elastic-cloud-apm-server-time-based-index-template/321076/4 "2022-12-13T02:21:58Z")

</div>

If you upgrade to 8.x It will do that automatically with data streams... 🙂

All the backing indices for data streams are daily and have the date as part of the index name...

---

<div class="post-metadata">

**Author:** ![Ali\_Nazemian](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@Ali\_Nazemian](https://discuss.elastic.co/u/Ali_Nazemian)\
**Post date:** [December 13, 2022, 3:19am UTC](https://discuss.elastic.co/t/elastic-cloud-apm-server-time-based-index-template/321076/5 "2022-12-13T03:19:28Z")

</div>

@stephenb Ah, is there any way to do that with 7.17.x? The upgrade is planned but won't happen over the next few months, so wondering if there is any way to do it with 7? I could find some instructions but they all seem to be for self-managed clusters where you have access to all configs not sure how that could work with the cloud version.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 13, 2022, 4:23am UTC](https://discuss.elastic.co/t/elastic-cloud-apm-server-time-based-index-template/321076/6 "2022-12-13T04:23:05Z")

</div>

Show me what you found... That is probably legacy APM server I suspect you are running the Integration Server.

But either way it is not super straight forward... With the ILM it will work just not have the date in it....

---

<div class="post-metadata">

**Author:** ![Ali\_Nazemian](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@Ali\_Nazemian](https://discuss.elastic.co/u/Ali_Nazemian)\
**Post date:** [December 13, 2022, 6:55am UTC](https://discuss.elastic.co/t/elastic-cloud-apm-server-time-based-index-template/321076/7 "2022-12-13T06:55:18Z")

</div>

Here are a couple of previous threads:

> [@How can I create a APM Template with timestamps and the 0000n (for ILM)](https://discuss.elastic.co/t/how-can-i-create-a-apm-template-with-timestamps-and-the-0000n-for-ilm/302338):
>
> Hello to the community, I am trying to setup APM with an ILM that I configured manually. If I use the default index available in the output.Elasticsearch, I get indexes similar to "apm-7.16.3-error-000001". I now need to add a timestamp to my indexes so that I can know at which date they were created without having to go thru the details of each index individually. I have referred to the the below docs and pages and tried to get to the mentioned config : [How to set ElasticSearch Apm Server i…](https://discuss.elastic.co/t/how-to-set-elasticsearch-apm-server-indexing-template-as-yyyy-mm/177811)

> [@How to set ElasticSearch Apm Server indexing template as YYYY.mm?](https://discuss.elastic.co/t/how-to-set-elasticsearch-apm-server-indexing-template-as-yyyy-mm/177811):
>
> I just created Apm server it looks awesome but Indexing like that"Apm-6.6.2-2019.04.19" doesn't make sense because I will have at the end of the month 30 logs. I want to use change "apm-%{[beat.version]}-%{+yyyy.MM}" instead of "apm-%{[beat.version]}-%{+yyyy.MM.dd}" Below code is my purpose but it's not working: Kibana,Elastic.Apm : 6.6.2 apm-server: host: mycompany.name.com:8200 output.elasticsearch: # Array of hosts to connect to. hosts: ["http://mycompany.name.com:9200"] index: "a…

---

<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 3, 2023, 2:55am UTC](https://discuss.elastic.co/t/elastic-cloud-apm-server-time-based-index-template/321076/8 "2023-01-03T02:55:24Z")

</div>

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