LoginSignup
0
1

More than 1 year has passed since last update.

CloudWatch Logs Insights 備忘録

Last updated at Posted at 2022-10-14

日付+UserAgent毎に アクセス数を集計

@messageの中のフィールドに userAgent というキーがある場合

stats count(*) by datefloor(@timestamp, 1d) as day, userAgent
|limit 10000

デフォルトでは、1000行までしか出力してくれない為、limit 10000(最大)を指定
limit は別行 に書く必要あり

@message中のステータスコードが200以上のログ

fields @timestamp, @message 
| filter status > 200

日付+ステータスコード毎のアクセス数を集計

stats count(*) by datefloor(@timestamp, 1d) as da, status

日本時間に直す

toMillis(@timestamp) + 32400000 
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1