首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Logstash筛选mysql慢查询

Logstash筛选mysql慢查询
EN

Stack Overflow用户
提问于 2018-11-05 13:54:36
回答 1查看 522关注 0票数 0

我尝试使用grok来过滤mysql的慢速查询。我需要

  • 数据库名
  • 用户
  • IP地址
  • Query_time
  • 命令

谁来帮帮我?

代码语言:javascript
复制
# User@Host: tysa6775_ua_data[tysa6775_ua_data] @ localhost []  Id:   360
# Query_time: 1.627188  Lock_time: 0.000246 Rows_sent: 5566  Rows_examined: 459414
use tysa6775_au_data1;
SET timestamp=1541421036;
select * from table_rating where id_product=1009 order by ngaytao desc;
# User@Host: tysa6775_ua_data[tysa6775_ua_data] @ localhost []  Id:   360
# Query_time: 0.000569  Lock_time: 0.000308 Rows_sent: 0  Rows_examined: 3
SET timestamp=1541421036;
select * from table_hoidap where id_product=1009 order by ngaytao desc;
# User@Host: tysa6775_ua_data[tysa6775_ua_data] @ localhost []  Id:   360
# Query_time: 0.000349  Lock_time: 0.000208 Rows_sent: 0  Rows_examined: 28
SET timestamp=1541421036;
select * from table_product_like where id_product='1009' and ip_nguoilike='5.188.210.8' order by stt,id desc;
EN

回答 1

Stack Overflow用户

发布于 2018-11-09 20:33:25

由于您试图访问的数据分散在日志文件中的多行中,所以您需要使用多行编解码器,它将从这些行中生成一个事件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53155791

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档