How to dynamically turn off slowlog

I might be a bit daft on this one, but how would i turn off slow logging through an HTTP call? I used the command in the logging docs, https://www.elastic.co/guide/en/elasticsearch/guide/current/logging.html, to turn on logging and it worked fine. But my SA asked how he can turn off slow logs if he needs to.

If I added it this way, how would I turn off the same settings? Put blank values in? DELETE? I'm probably missing something obvious.

PUT /my_index/_settings
{
"index.search.slowlog.threshold.query.warn" : "10s",
"index.search.slowlog.threshold.fetch.debug": "500ms",
"index.indexing.slowlog.threshold.index.info": "5s"
}

1 Like

You could try -1, can't guarantee it'll work.

How about

GET /my_index/_settings

Modify the resource (i.e. remove the slowlog paramaters). Then POST it back. (or DELETE then PUT it back?)

As always, no guarantee. You should test it on dummy index first.

Edit: @warkolm is correct. -1 should work

https://www.elastic.co/guide/en/elasticsearch/reference/2.1/index-modules-slowlog.html

2 Likes

Thanks! Totally missed that page.