如何在elasticsearch.yml中添加慢速日志配置?

时间:2016-12-27 10:08:09

标签: elasticsearch

在旧版本的elasticsearch中,slowlog将在elasticsearch.yml中 对于像5.1.1这样的新版本,我们必须添加类似慢速日志的配置     index.search.slowlog.threshold.query.debug:0s     index.search.slowlog.threshold.fetch.debug:0s     index.indexing.slowlog.threshold.index.debug:0s

我尝试在elasticsearch.yml中添加这些配置,当我启动弹性搜索服务时,它没有启动它会引发错误。

任何人都可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:2)

自Elasticsearch 5以来,每个索引的日志设置都很慢。

您可以将设置设为特定索引/ index_name / _settings

使用如下所示的有效负载。有关详细信息,请访问Elasticsearch Reference

{
"index.search.slowlog.threshold.query.warn": "10s",
"index.search.slowlog.threshold.query.info": "5s",
"index.search.slowlog.threshold.query.debug": "2s",
"index.search.slowlog.threshold.query.trace": "300ms",
"index.search.slowlog.threshold.fetch.warn": "1s",
"index.search.slowlog.threshold.fetch.info": "800ms",
"index.search.slowlog.threshold.fetch.debug": "500ms",
"index.search.slowlog.threshold.fetch.trace": "300ms",
"index.indexing.slowlog.threshold.index.warn": "10s",
"index.indexing.slowlog.threshold.index.info": "5s",
"index.indexing.slowlog.threshold.index.debug": "2s",
"index.indexing.slowlog.threshold.index.trace": "300ms",
"index.indexing.slowlog.level": "trace",
"index.indexing.slowlog.source": "1000"
}