Kinesis Firehose writes to S3 cloud watch subscription filter but the files are not readable - amazon-cloudwatch

I've noticed that Kinesis firehose writes files to kinesis but the files are in non readable human format (probably compressed or binary).
I didn't choose to zip or to encrypt them.
How can i convert the content of this files for human readable format?

Cloud watch logs pipe with firehose to S3 are being automatically gzip compressed when export to designated S3 bucket.
But Firehose wont add the .gz extension to the file so when you download it from s3 bucket you need to manually add the gz extension to the file.
And then decompress the file delivered to s3 bucket first before opening it.

Related

How to compress video in AWS s3 storage?

I am very new to AWS, we are just using s3 bucket to save video data generated from our web application backend.
We have a check in backend, if video size from front end in mora than 65mb it wont send to aws s3.
Due to new devices coming in the market and because of high resolution the size of the video is increasing.
Is there any way in aws s3, before saving or after saving to s3 bucket, compress it automatically.
I did some research there is MediaConvert service where we can do manually compression.
But i need as soon as we save from our application it should be compressed and save in s3.
AWS S3 will not compress the files for storage. It stores what you provide. If you want S3 to store compressed videos, you need to compress the videos yourself and upload them to S3 that way.
The objects you upload need to be compressed before they're uploaded.

How to make ohif look at s3 for loading studies

I have built object storage plugin to store orthanc data in s3 bucket in legacy mode. I am now trying to eliminate local storage of files of orthanc and move it to s3 completely. I also have OHIF viewer integrated which is serving orthanc data, How do I make it fetch from s3 bucket? I have read that json file of dicom file can be used to do this, but I dont know how to do that because the json file has url of each instance in s3 bucket. How do i generate this json file if this is the way to do it?

Is there a way to compress 20 - 40mb images when uploading to S3?

I am looking to create a way where when I upload a file to S3, I would want an original copy and compressed copy that stores in different folders in the same bucket (different bucket works too). I tried to do that with the serverless app repository 'compress'. However, it does not compress images > 4MB
The structure I want to create is:
I upload the file to S3
The original file (with the 100% file size) goes into one folder
A compressed copy is created that goes into another folder in the same bucket
Is there a way to do figure this out? I'm new to AWS
Yes, you can achieve this by doing the following.
Uploaded file to S3 triggers a bucket event notification with a destination of an AWS Lambda. The Lambda reads the file from S3, compresses the file, and then saves the file to another folder in the same bucket

Is there a way to specify file extension to the file saved to s3 by kinesis firehose

I am setting up a kinesis firehose stream and everything works well with the files getting created on s3 which are delimited. But i was wondering if there is a way to specify an extension to this file since the consumer of this file require it to be either a csv or txt. Is there any way of doing this?
Thanks
You can create an s3 trigger to lambda and rename from there.
I was not able to get an extension for the files generated by firehose but I ended up using data pipeline to do this by using the ShellCommandActivity component which allows one to run shell commands on the files in Amazon S3 and write the resulting files to either S3 or any other location that you'd like.

Compress file on S3

I have a 17.7GB file on S3. It was generated as the output of a Hive query, and it isn't compressed.
I know that by compressing it, it'll be about 2.2GB (gzip). How can I download this file locally as quickly as possible when transfer is the bottleneck (250kB/s).
I've not found any straightforward way to compress the file on S3, or enable compression on transfer in s3cmd, boto, or related tools.
S3 does not support stream compression nor is it possible to compress the uploaded file remotely.
If this is a one-time process I suggest downloading it to a EC2 machine in the same region, compress it there, then upload to your destination.
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html
If you need this more frequently
Serving gzipped CSS and JavaScript from Amazon CloudFront via S3
Late answer but I found this working perfectly.
aws s3 sync s3://your-pics .
for file in "$(find . -name "*.jpg")"; do gzip "$file"; echo "$file"; done
aws s3 sync . s3://your-pics --content-encoding gzip --dryrun
This will download all files in s3 bucket to the machine (or ec2 instance), compresses the image files and upload them back to s3 bucket.
Verify the data before removing dryrun flag.
There are now pre-built apps in Lambda that you could use to compress images and files in S3 buckets. So just create a new Lambda function and select a pre-built app of your choice and complete the configuration.
Step 1 - Create a new Lambda function
Step 2 - Search for prebuilt app
Step 3 - Select the app that suits your need and complete the configuration process by providing the S3 bucket names.