Skip to content

Instantly share code, notes, and snippets.

@digitalm
Created May 13, 2022 10:01
Show Gist options
  • Save digitalm/ebb019f9757e15ea63015f8e92e29c5b to your computer and use it in GitHub Desktop.
Save digitalm/ebb019f9757e15ea63015f8e92e29c5b to your computer and use it in GitHub Desktop.
Cloudwatch Logs Insights クエリ構文
# 20s 以上かかった 200 OK のリクエストログ行を出力
fields @timestamp, @message
| filter @message like /Completed 200 OK in /
| parse '*, [* *] * -- : [*] Completed 200 OK in *ms (*)' as key,ts,hash,level,req_hash,ms,detail
| display key,ts,hash,level,req_hash,ms,detail
| filter (ms>20000)
# https://docs.aws.amazon.com/ja_jp/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment