Elasticsearch索引慢日志配置
设置索引慢日志各种级别下的阀值,同时也支持多索引(索引名按逗号分隔)和全索引(用*通配符)操作。
curl -XPUT --tlsv1.2 --negotiate -k -v -u : 'https://ip:httpport/myindex-001/_settings?pretty' -H 'Content-Type: application/json' -d'
{
"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": "500ms",
"index.indexing.slowlog.source": "1000"
}'
index.indexing.slowlog.threshold.index.*:对应日志级别下的阀值,索引时间慢于该阀值即打印日志。
index.indexing.slowlog.source:Elasticsearch默认将在慢索引日志中记录_source的前1000个字符,将其设置为false或0将完全跳过记录源,设置为true将记录整个源。