Elasticsearch查询慢日志配置

南墨2年前技术文章1117

shard级别的查询慢日志会将慢查询(查询和获取阶段)记录到elasticsearch_cluster_index_search_slowlog.log日志中。

设置查询慢日志各种级别下的阀值,同时也支持多索引(索引名按逗号分隔)和全索引(用*通配符)操作。

curl -XPUT --tlsv1.2 --negotiate -k -v -u : 'https://ip:httport/myindex-001/_settings?pretty' -H 'Content-Type: application/json' -d'
{
"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": "500ms",
"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": "200ms",
}'

index.search.slowlog.threshold.query.*:对应日志级别下的阀值,查询阶段慢于该阀值即打印日志。

index.search.slowlog.threshold.fetch.*:对应日志级别下的阀值,提取阶段慢于该阀值即打印日志。


相关文章

Linux下的IO统计工具:iostat,iotop

Linux下的IO统计工具:iostat,iotop

iostat      监视系统输入输出设备和CPU的使用情况。iostat命令 被用于监视系统输入输出设备和CPU的使用情况。它的特点是汇报磁盘活动统计情况,同时也会汇报出CPU使用情况。同vmst...

Kubernetes 网络插件

Kubernetes 自身并不提供网络解决方案,允许托管使用第三方的网络解决方案。flannelcalicocanelkube-router......各种 CNI 插件的解决方案: 虚拟网桥(bri...

kaniko构建镜像的方式

docker构建镜像用docker来构建容器镜像也是常用的方法,在具备构建容器镜像所需的两个要素(Dockerfile & 上下文)的前提下,用下述命令就能构建一个容器镜像出来```Plain...

MySQL运维实战之元数据和数据字典

什么是元数据假设我们执行一个简单的SQL:select * from tab where col = 'value'...

添加环境变量的两种方式

添加环境变量的两种方式

添加环境变量的几种方式:1.添加当前用户的PATH环境变量,作用范围仅限于当前用户修改用户目录下的 .bashrc修改后立即生效。vim ~/.bashrc2.添加所有用户的PATH环境变量,适用于所...

oracle设置归档路径和格式

1.归档文件格式设置说明:设置归档日志名称格式:alter system set log_archive_format='arch_%t_%s_%r.arc' scope=spfile sid='*'...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。