Skip to content

Instantly share code, notes, and snippets.

View olen2006's full-sized avatar
🐙
https://youtu.be/TulBh6klMuU

General Zod olen2006

🐙
https://youtu.be/TulBh6klMuU
  • Solar System, Earth
View GitHub Profile
@olen2006
olen2006 / aws-cf-logs
Created May 12, 2019 01:40 — forked from shapeshed/aws-cf-logs
Fetch AWS Cloudfront Logs, decompress, combine into a single file and remove comments
#!/usr/bin/env bash
BUCKET=$1
CWD=$(pwd)
if [[ -n $1 ]]; then
aws s3 sync s3://$BUCKET/cf-logs .
cat *.gz > combined.log.gz
find $CWD ! -name 'combined.log.gz' -name '*.gz' -type f -exec rm -f {} +
gzip -d combined.log.gz