弹性搜索日志配置不起作用

时间:2017-10-18 10:04:55

标签: elasticsearch

我尝试使用以下链接

在弹性搜索服务器中启用日志

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

我使用网址验证了我的索引设置 http://localhost:9200/_all/_settings

结果如下

{"myindex":{"settings":{"index":{"search":{"slowlog":{"threshold":{"fetch":{"warn":"1ms","trace":"1ms","debug":"1ms","info":"1ms"},"query":{"warn":"1ms","trace":"1ms","debug":"1ms","info":"1ms"}}}},"number_of_shards":"3","provided_name":"occindex","creation_date":"1508319257925","number_of_replicas":"2","uuid":"dVAWgk62Sgivzr2B_OuCzA","version":{"created":"5040399"}}}}}

根据文档,我希望在违反阈值时填充日志。

我已设置1 ms作为阈值,以便记录所有正在进行弹性搜索的查询

我发现在logs文件夹下,日志文件 elasticsearch_index_search_slowlog.log elasticsearch.log 不会显示弹性搜索的查询。

如果我的配置正确,请告诉我。

1 个答案:

答案 0 :(得分:0)

插入一条记录后,日志工作正常。

如果在索引中没有记录时触发查询,则日志未更新