This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## CloudFrontのアクセスログ調査 | |
### 4xx/5xxで応答したリクエストの集計 | |
cat * | awk -F' ' '$2 ~ "xx:[0-9][0-9]:[0-9][0-9]" && $9 ~ "4[0-9][0-9]" {print $5}'| sort | uniq -c | sort -r | |
### 2xx以外のIP集計 | |
cat * | awk -F' ' '($2 ~ "xx:[0-9][0-9]:[0-9][0-9]") && !($9 ~ "2[0-9][0-9]") {print $5}'| sort | uniq -c | sort -r | |
### 2xx以外のURI集計 | |
cat * | awk -F' ' '$2 ~ "xx:[0-9][0-9]:[0-9][0-9]" && !($9 ~ "2[0-9][0-9]") {print $8}'| sort | uniq -c | sort -r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# S3のAWS CLIのチートシート | |
### ファイル数、ファイルサイズ取得 | |
aws s3 ls s3://path/to/file --recursive --human --sum | |
### Bucket PolicyをJSONで取得 | |
aws s3api get-bucket-policy --bucket {bucket name} --query Policy --output text | jq . --indent 4 | |
### 圧縮されたアクセスログのダウンロード&解凍 | |
aws s3 cp s3://bucketname/path/ . --recursive --exclude "*" --include "*.log.gz"; find . -name '*.gz' | xargs -n1 gunzip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RDSのAWS CLIチートシート | |
# 利用可能なエンジンバージョンを調べるコマンド | |
aws rds describe-orderable-db-instance-options \ | |
--engine aurora-postgresql \ | |
--db-instance-class db.r5.large \ | |
--query 'OrderableDBInstanceOptions[].[DBInstanceClass,StorageType,Engine,EngineVersion]' \ | |
--output table \ | |
--region ap-northeast-3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ec2のAWS CLIのチートシート |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CloudWatchLogsのAWS CLIチートシート |