我希望能够在一段时间内将slowlogs时间设置为0,然后将设置重置回默认值。我使用
curl -X PUT -H "Content-Type: application/json" -d '{"index.search.slowlog.threshold.query.warn": "0s"}' "<ADDRESS>:9200/index/_settings"激活慢日志。这增加了
"search": {
"slowlog": {
"threshold": {
"query": {
"warn": "0s"
}
}
}
}添加到设置。我能做到
curl -X PUT -H "Content-Type: application/json" -d '{"index.search.slowlog.threshold.query.warn": "-1"}' "<ADDRESS>:9200/index/_settings"来停用慢日志,但这会留下新的设置块,在那里我希望设置恢复到我干预之前的状态。
有没有办法将设置恢复为默认设置?(理想情况下,删除整个新块,以便设置与以前完全相同。)
发布于 2019-01-11 20:04:43
您想要的是不可能的,相反,您可以查看https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-slowlog.html并查看慢速日志设置的默认值,然后当您想要恢复这些设置时,只需使用默认值更新日志设置。
发布于 2021-03-25 12:16:47
您可以通过传递null作为设置的值来重置为默认值。
curl -X PUT -H "Content-Type: application/json" \
-d '{"index.search.slowlog.threshold.query.warn": null}' \
"<ADDRESS>:9200/index/_settings"通过https://www.elastic.co/guide/en/elasticsearch/reference/7.12/indices-update-settings.html#reset-index-setting接口更新索引设置的Elasticsearch文档
https://stackoverflow.com/questions/54145250
复制相似问题