Skip to content

Instantly share code, notes, and snippets.

View danyal14's full-sized avatar

Danyal AB danyal14

View GitHub Profile
@danyal14
danyal14 / cloudwatch_log_insights_mysql_slow_query_examples.md
Created September 1, 2022 08:10 — forked from qiangxue/cloudwatch_log_insights_mysql_slow_query_examples.md
CloudWatch Log Insights query examples for MySQL slow query log.

Filtering queries

Find slowest write queries

parse @message /Query_time: (?<queryTime>.*?) Lock_time: (<?lockTime>.*?) Rows_sent: (?<rowsSent>.*?) Rows_examined: (?<rowsExamined>.*?)\s(?<query>.*?)$/
  | filter @message like /(?i)insert/
  | sort queryTime desc
  | limit 10