I have setup a cloudwatch log group to stream logs via kinesis & firehose into an s3 bucket, as gzip-ed files.
The gzip files are all tagged with some Metadata:
Content-Encoding gzip
Content-Type application/octet-stream
When I download one of the files directly from the browser console and unzip it I get the expected contents of a log file, namely json strings. However, if I use the aws CLI to cp the file locally and unzip the contents then the file renders as binary at the terminal.
What could be the cause in the difference in behavior between the AWS Console download button and the AWS CLI s3 cp command?
I have already tried to specify various combinations of command line flags
aws s3 cp --content-encoding gzip --content-type "application/json"
aws s3 cp --content-encoding gzip --content-type "application/octet-stream"
aws s3 cp --content-encoding gzip --content-type "application/octet-stream" --sse-kms-key-id <keyArn>
But none of them have produced the positive result I get from using the Console in the browser.
UPDATE
The s3 cli version of the file is almost 10KB larger than the management console version.
cpand everything went well -aws s3 cp s3://${MY_BUCKET}/test.txt.gz test.txt.gz- Amit Baranesgunzipis applied locally (after downloading). - Ramón J Romero y Vigil