Slide 12
Slide 12 text
Copyright coconala Inc. All Rights Reserved.
ログ分析(CloudWatch)
12
parse @message /Query_time: (?\d+\.\d+)[^\n]*\nSET timestamp=\d+;\n(?.*)$/
| parse @message /\]\s+@\s+\[(?[\d\.]+)\]/
| filter host != 'バッチサーバの IP' and host != ‘管理画面サーバの IP' # 直接ユーザーの操作に影響を与える箇所を優先する
| fields substr(sql_tmp, 0, 64) as sql # 集計のため、適当な長さに切る
| filter strlen(sql) > 1 # ゴミデータの除去
| stats count(*) as cnt, pct(query_time, 70) as p70, pct(query_time, 95) as p95, max(query_time) as max_time, min(query_time) as min_time by sql
| sort cnt desc