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
回答済み 1年前
profile picture
エキスパート
レビュー済み 1ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ