0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

CloudWatchでログを抽出する

Last updated at Posted at 2023-08-07

CloudWatchのログのインサイトでログを抽出した時のメモ。

対象のフィールドを指定

fields @timestamp, @message, @log

ログをソート

fields @timestamp, @message, @log
| sort @timestamp desc

文字列で絞り込み

fields @timestamp, @message, @log
| filter @message like /ERROR/

ログをパースしてフィールドして表示

fields @timestamp, @message, @log
| parse @message 'param1=*&' as param1
fields @timestamp, @message, @log
| parse @message "*\t*\t*\t*\t*" as datetime,statuscode,id,param1,param2

表示する項目を指定

fields @timestamp, @message, @log
| parse @message "*\t*\t*\t*\t*" as datetime,statuscode,id,param1,param2
| display datetime, statuscode
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?