欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > 数据库 >内容正文

数据库

MySQL慢查询日志ES索引模板

发布时间:2025/3/21 数据库 26 豆豆
生活随笔 收集整理的这篇文章主要介绍了 MySQL慢查询日志ES索引模板 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
{"template": "mysql-slow-log-*","settings": {"index": {"refresh_interval": "5s"}},"mappings": {"mysql-slow-log": {"numeric_detection": true, //开启数值类型设置"properties": {"@timestamp": {"type": "date","format": "strict_date_optional_time||epoch_millis"},"@version": {"type": "string"},"Query_time": {"type": "double" //设置该字段为double类型的 },"Row_sent": {"type": "string"},"Rows_examined": {"type": "string"},"clientip": {"type": "string"},"envCode": {"type": "string"},"host": {"type": "string"},"id": {"type": "string"},"lock_time": {"type": "string"},"message": {"type": "string"},"mysqlType": {"type": "string","norms": {"enabled": false},"fielddata": {"format": "disabled"},"fields": { //产生.raw聚合"raw": {"type": "string","index": "not_analyzed","ignore_above": 256}}},"nsCode": {"type": "string"},"path": {"type": "string"},"sql": {"type": "string","index": "not_analyzed" //在创建索引的时候,该字段不分词 },"tags": {"type": "string"},"timestamp": {"type": "string"},"type": {"type": "string"},"user": {"type": "string"}}}} }

 

转载于:https://www.cnblogs.com/crysmile/p/7071766.html

总结

以上是生活随笔为你收集整理的MySQL慢查询日志ES索引模板的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。