# How do we enable slow search queries logging in Elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-do-we-enable-slow-search-queries-logging-in-elasticsearch/94>\
**Category:** Elasticsearch\
**Created:** [May 1, 2015, 10:28am UTC](https://discuss.elastic.co/t/how-do-we-enable-slow-search-queries-logging-in-elasticsearch/94 "2015-05-01T10:28:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [May 1, 2015, 10:28am UTC](https://discuss.elastic.co/t/how-do-we-enable-slow-search-queries-logging-in-elasticsearch/94/1 "2015-05-01T10:28:54Z")

</div>

The slow log settings are node settings and not index settings, so you can't change these settings via the update index settings api.

You can change these settings via the cluster update api:

```auto
PUT /_cluster/settings
{
 "transient": {
 "index.search.slowlog.threshold.query.warn": "60s",
 "index.search.slowlog.threshold.query.info": "50s",
 "index.search.slowlog.threshold.query.debug": "40s",
 "index.search.slowlog.threshold.query.trace": "20s",
 "index.search.slowlog.threshold.fetch.warn": "30s",
 "index.search.slowlog.threshold.fetch.info": "50s",
 "index.search.slowlog.threshold.fetch.debug": "40s",
 "index.search.slowlog.threshold.fetch.trace": "20s",
 "index.indexing.slowlog.threshold.index.warn": "60s",
 "index.indexing.slowlog.threshold.index.info": "50s",
 "index.indexing.slowlog.threshold.index.debug": "40s",
 "index.indexing.slowlog.threshold.index.trace": "20s"
 }
}

```

For more info, see the [slow log documentation page](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules-slowlog.html#search-slow-log).

---

<div class="post-metadata">

**Author:** ![Puneet\_Jaiswal](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@Puneet\_Jaiswal](https://discuss.elastic.co/u/Puneet_Jaiswal)\
**Post date:** [August 27, 2015, 9:30pm UTC](https://discuss.elastic.co/t/how-do-we-enable-slow-search-queries-logging-in-elasticsearch/94/2 "2015-08-27T21:30:45Z")

</div>

HI,

I happened to change this setting once for debugging purpose.  
A few indices were created with this setting.

Now I need to reset it back.  
I tried doing put and it gets acknowledged as well but slow log threshold does not change from index settings.  
Is there any way to verify if slow log settings are saved and applied in the cluster ?

Thanks.

---

<div class="post-metadata">

**Author:** ![SuNyl\_SiNgh](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@SuNyl\_SiNgh](https://discuss.elastic.co/u/SuNyl_SiNgh)\
**Post date:** [July 12, 2016, 10:23am UTC](https://discuss.elastic.co/t/how-do-we-enable-slow-search-queries-logging-in-elasticsearch/94/3 "2016-07-12T10:23:04Z")

</div>

This doesn't work, i am looking for api which can be used to set the above slow-log in my cluster

How can we do this via. ES api ? Is it possible ?

I am using :  
curl -XPUT http://:9200/\_cluster/settings -d '{ "transient" : { "index.search.slowlog.threshold.query.warn": "60s" } }'

And got the below response  
{"acknowledged":true,"persistent":{},"transient":{}}

Please suggest !! Thanks in advance

---

<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:** [July 5, 2017, 10:36pm UTC](https://discuss.elastic.co/t/how-do-we-enable-slow-search-queries-logging-in-elasticsearch/94/4 "2017-07-05T22:36:18Z")

</div>


