# How to enable and disable slow logs in Elasticsearch

**URL:** <https://discuss.elastic.co/t/how-to-enable-and-disable-slow-logs-in-elasticsearch/363978>\
**Category:** Elasticsearch\
**Created:** [July 29, 2024, 11:47am UTC](https://discuss.elastic.co/t/how-to-enable-and-disable-slow-logs-in-elasticsearch/363978 "2024-07-29T11:47:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Test\_Test3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/test_test3/32/123756_2.png) [@Test\_Test3](https://discuss.elastic.co/u/Test_Test3)\
**Post date:** [July 29, 2024, 11:47am UTC](https://discuss.elastic.co/t/how-to-enable-and-disable-slow-logs-in-elasticsearch/363978/1 "2024-07-29T11:47:47Z")

</div>

Using Elastic 8.10.4 version.

1. How to enable slow logs for existing indices and future indices? Also how to skip the system level indices?

2. If i need to disable slow logs after testing, how to disable it?

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [July 29, 2024, 1:31pm UTC](https://discuss.elastic.co/t/how-to-enable-and-disable-slow-logs-in-elasticsearch/363978/2 "2024-07-29T13:31:32Z")

</div>

Hi @Test_Test3,

Welcome to the community! In terms of your questions:

1. You can configure the thresholds [at an index level as covered in the documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-slowlog.html#index-slow-log). I'm not sure about system-level indices, but it's possible to do that by setting `index.indexing.slowlog.source` to `false` or `0`.
2. If you're wanting to test things out you could try playing with the levels as [listed here](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-slowlog.html#_slow_log_levels) .

Hope that helps!

---

<div class="post-metadata">

**Author:** ![Test\_Test3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/test_test3/32/123756_2.png) [@Test\_Test3](https://discuss.elastic.co/u/Test_Test3)\
**Post date:** [July 29, 2024, 1:40pm UTC](https://discuss.elastic.co/t/how-to-enable-and-disable-slow-logs-in-elasticsearch/363978/3 "2024-07-29T13:40:39Z")

</div>

I have lot of indices existing and cannot apply to individually. so applying \* will make it applicable to system indices like .kibana, ilm indices etc., which i dont want so any regex pattern to skip the special indices starts with a dot(like .kibana)

If i enable using below  
"index.search.slowlog.threshold.query.info": "0s",

how to disable the above? should i set the value again to -1 ?
