Download, decompress and consolidate AWS CloudFront CDN logs from the specified S3 bucket into a single, human-readable file on the local Windows machine.
The following needs to be completed before using this cmd:
- All CloudFront logs must be stored on a single S3 bucket in your AWS account.
- AWS CLI and gzip must be installed.
- The path where aws.exe and gzip.exe are installed must be included in the PATH system variable.
- AWS configure must be run and the access keys and region must be set.
- Copy the files from the dos folder of this git to the folder where you would like to generate the CloudFront log file.
On the DOS command prompt type the following command:
getcflog <websitename/s3-bucket-name> [cf-indicator]
describtion of the arguments are as follows:
website for which cloudfront logs need to be downloaded. Use this if the bucket name of it's cloudfront logs are in the format
logs.websitename/cdn
otherwise use s3-bucket-name directly.
the name of the bucket where the cloudfront logs are stored.
set this to Y if using s3-bucket-name. If using websitename, this must be left blank (see under which condition websitename can be used).
The Output File would be generated in the same folder with the following name format:
cf-logs.D-yyyy-mm-dd-T_hh_mm_ss.txt