How to enable and disable slow logs in Elasticsearch

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?

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. 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 .

Hope that helps!

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 ?