# How to dynamically turn off slowlog

**URL:** <https://discuss.elastic.co/t/how-to-dynamically-turn-off-slowlog/36244>\
**Category:** Elasticsearch\
**Created:** [December 3, 2015, 5:42am UTC](https://discuss.elastic.co/t/how-to-dynamically-turn-off-slowlog/36244 "2015-12-03T05:42:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Loss](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@Jeremy\_Loss](https://discuss.elastic.co/u/Jeremy_Loss)\
**Post date:** [December 3, 2015, 5:42am UTC](https://discuss.elastic.co/t/how-to-dynamically-turn-off-slowlog/36244/1 "2015-12-03T05:42:28Z")

</div>

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](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"  
}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 3, 2015, 5:44am UTC](https://discuss.elastic.co/t/how-to-dynamically-turn-off-slowlog/36244/2 "2015-12-03T05:44:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vtst2412](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vtst2412/32/6228_2.png) [@vtst2412](https://discuss.elastic.co/u/vtst2412)\
**Post date:** [December 3, 2015, 5:51am UTC](https://discuss.elastic.co/t/how-to-dynamically-turn-off-slowlog/36244/3 "2015-12-03T05:51:04Z")

</div>

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](https://www.elastic.co/guide/en/elasticsearch/reference/2.1/index-modules-slowlog.html)

---

<div class="post-metadata">

**Author:** ![Jeremy\_Loss](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@Jeremy\_Loss](https://discuss.elastic.co/u/Jeremy_Loss)\
**Post date:** [December 4, 2015, 2:03am UTC](https://discuss.elastic.co/t/how-to-dynamically-turn-off-slowlog/36244/4 "2015-12-04T02:03:01Z")

</div>

Thanks! Totally missed that page.

---

<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, 11:33pm UTC](https://discuss.elastic.co/t/how-to-dynamically-turn-off-slowlog/36244/5 "2017-07-05T23:33:40Z")

</div>


