LoginSignup
0
0

More than 3 years have passed since last update.

障害調査で使うS3コマンド

Posted at

前提

  • AWS CLIがインストールされていること。

対象ファイルをダウンロード

コマンド
aws s3 cp s3://<バケット名> <ローカルのディレクトリ> --exclude "*" --include "<取得したいファイル>" --recursive

取得したいファイルについては、ワイルドカードが利用できる。

例)hogeバケットから2020年06月分のログ取得

コマンド
aws s3 cp s3://hoge ~/log --exclude "*" --include "202006*/**/*.gz" --recursive

全文検索

zgrepでgzipのまま検索できる。

コマンド
zgrep -r "<検索対象文字列>" <検索対象ディレクトリ>
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