Kinesis data Firehose Data Transformation and Compression

0

Hi all,

We are working on a solution based on CloudWatch Logs Destinations and Kinesis Firehose to be able to centralize CloudWatch Logs coming from multiple Application Accounts inside our Organization in a Centralized Log Account as shown in the attached image below and described also here :

Enter image description here

We are using a Lambda function triggered by the Firehose Stream for Data Transformation before sending data to the final destination S3 Bucket.

The Lambda should unzip the recieved data, process it and send it back to the Firehose Stream "Based on Firehose Lambda Blueprint"

Everything is working as expected, except for the Kinesis Firehose Compression, On the Firehose Destination Settings, We've already enabled Compression of data records in GZIP format but what we are recieving on the S3 Bucket are uncompressed files with .gz extension !!

Enter image description here

any idea on how to resolve this issue ?

should the Lambda compress the data records after processing them and before sending them back to the Firehose Stream and how ?

Thanks in advance

1개 답변
0
수락된 답변

I managed to figure out what wase the issue,

Kinesis Firehose while writing objects to S3, it adds a key/value pair, "Content-Encoding=gzip” to the metadata of the objects.

When we request to download the object from S3 on a browser(UI), this key/value is added to the response header which causes the browser to automatically decompress the object. Latest browsers come with this built-in feature to decompress such files upon download.

Hence, the files stored in the S3 bucket are in correct format with compressed values but when we download it, browser automatically decompresses it and it is an expected behaviour for Kinesis Firehose delivery to S3 with GZIP compression enabled.

profile picture
답변함 일 년 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인