How do we enable slow search queries logging in Elasticsearch?

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:

PUT /_cluster/settings
 "transient": {
 "": "60s",
 "": "50s",
 "": "40s",
 "": "20s",
 "": "30s",
 "": "50s",
 "": "40s",
 "": "20s",
 "index.indexing.slowlog.threshold.index.warn": "60s",
 "": "50s",
 "index.indexing.slowlog.threshold.index.debug": "40s",
 "index.indexing.slowlog.threshold.index.trace": "20s"

For more info, see the slow log documentation page.

1 Like


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 ?


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" : { "": "60s" } }'

And got the below response

Please suggest !! Thanks in advance