# Applying slowlog setting on daily rotated search index

**URL:** <https://discuss.elastic.co/t/applying-slowlog-setting-on-daily-rotated-search-index/299298>\
**Category:** Elasticsearch\
**Created:** [March 10, 2022, 6:00am UTC](https://discuss.elastic.co/t/applying-slowlog-setting-on-daily-rotated-search-index/299298 "2022-03-10T06:00:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nobuaki\_Ito](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nobuaki_ito/32/102850_2.png) [@Nobuaki\_Ito](https://discuss.elastic.co/u/Nobuaki_Ito)\
**Post date:** [March 10, 2022, 6:00am UTC](https://discuss.elastic.co/t/applying-slowlog-setting-on-daily-rotated-search-index/299298/1 "2022-03-10T06:00:17Z")

</div>

My team currently own an Elasticsearch with daily rotated index. The index name changes once the daily rotation completes, and hence it requires to have slowlog threshold configured after each daily rotation completes.

What would be the best solution to ensure that every newly built index has slowlog threshold configured? Is there any way to automate this configuration step?

---

<div class="post-metadata">

**Author:** ![sagarpatel](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sagarpatel](https://discuss.elastic.co/u/sagarpatel)\
**Post date:** [March 10, 2022, 6:21am UTC](https://discuss.elastic.co/t/applying-slowlog-setting-on-daily-rotated-search-index/299298/2 "2022-03-10T06:21:32Z")

</div>

I hope you are using index template for creating rotated or rolling indices and not creating manully or from custom code.

If you are using index teamplate then you can specify slow log configuration in setting object of [index template API](https://www.elastic.co/guide/en/elasticsearch/reference/7.14/indices-put-template.html).

---

<div class="post-metadata">

**Author:** ![Nobuaki\_Ito](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nobuaki_ito/32/102850_2.png) [@Nobuaki\_Ito](https://discuss.elastic.co/u/Nobuaki_Ito)\
**Post date:** [March 10, 2022, 7:06am UTC](https://discuss.elastic.co/t/applying-slowlog-setting-on-daily-rotated-search-index/299298/3 "2022-03-10T07:06:40Z")

</div>

Thanks, this is a search index generated by Magento2(an e-commerce software package) code base.

Magento2 loads product information from a database and generates search index based on the information stored on that database.

I took a quick look at the API but wasn't able to find the exact index template. Will need to dig deeper into what is going on.

Cheers,

---

<div class="post-metadata">

**Author:** ![sagarpatel](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sagarpatel](https://discuss.elastic.co/u/sagarpatel)\
**Post date:** [March 10, 2022, 7:38am UTC](https://discuss.elastic.co/t/applying-slowlog-setting-on-daily-rotated-search-index/299298/4 "2022-03-10T07:38:22Z")

</div>

Sure. Please check and post comment if you have any doubt.

---

<div class="post-metadata">

**Author:** ![Nobuaki\_Ito](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nobuaki_ito/32/102850_2.png) [@Nobuaki\_Ito](https://discuss.elastic.co/u/Nobuaki_Ito)\
**Post date:** [March 16, 2022, 2:58am UTC](https://discuss.elastic.co/t/applying-slowlog-setting-on-daily-rotated-search-index/299298/5 "2022-03-16T02:58:45Z")

</div>

FYI, I was able to solve this issue by adding code on magento2 plugin. (Magento\Elasticsearch\Model\Adapter\Index\Builder)

---

<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:** [April 13, 2022, 2:58am UTC](https://discuss.elastic.co/t/applying-slowlog-setting-on-daily-rotated-search-index/299298/6 "2022-04-13T02:58:59Z")

</div>

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