我尝试使用以下链接在弹性搜索服务器中启用日志
https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-slowlog.html
我使用 url 验证了我的索引设置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 毫秒设置为阈值,以便记录所有命中弹性搜索的查询
我观察到在 logs 文件夹下,日志文件 elasticsearch_index_search_slowlog.log 和 elasticsearch.log 没有显示命中弹性搜索的查询。
让我知道我的配置是否正确。
插入一条记录后日志工作。
如果在索引中没有记录时触发查询,则日志未更新