Skip to content

Commit

Permalink
Adding gzip decompression to lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
f-galland committed Jul 10, 2024
1 parent 3b37d05 commit b85e34f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion integrations/amazon-security-lake/src/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import urllib.parse
import json
import gzip
import boto3
import pyarrow as pa
import pyarrow.parquet as pq
Expand Down Expand Up @@ -31,7 +32,8 @@ def get_events(bucket: str, key: str) -> list:
logger.info(f"Reading {key}.")
try:
response = s3_client.get_object(Bucket=bucket, Key=key)
data = response['Body'].read().decode('utf-8')
#data = response['Body'].read().decode('utf-8')
data = gzip.decompress(response['Body'].read()).decode('utf-8')
return data.splitlines()
except ClientError as e:
logger.error(
Expand Down

0 comments on commit b85e34f

Please sign in to comment.