From 1109a8b2cc67fa5c990c5ef81879d98990277db8 Mon Sep 17 00:00:00 2001 From: Vincent Boutour Date: Fri, 22 Nov 2024 13:46:50 +0100 Subject: [PATCH] fix(aws): Remove none extracted value by regex (#870) * fix(aws): Remove none extracted value by regex Signed-off-by: Vincent Boutour * fixup! fix(aws): Remove none extracted value by regex Signed-off-by: Vincent Boutour --------- Signed-off-by: Vincent Boutour --- aws/logs_monitoring/steps/handlers/s3_handler.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aws/logs_monitoring/steps/handlers/s3_handler.py b/aws/logs_monitoring/steps/handlers/s3_handler.py index 6eabd19b..f4a4cb8f 100644 --- a/aws/logs_monitoring/steps/handlers/s3_handler.py +++ b/aws/logs_monitoring/steps/handlers/s3_handler.py @@ -8,6 +8,7 @@ import boto3 import botocore + from settings import ( CN_STRING, DD_CUSTOM_TAGS, @@ -293,8 +294,10 @@ def _extract_other_logs(self): self.data_store.data = self.data_store.data.decode("utf-8", errors="ignore") if self.multiline_regex_start_pattern.match(self.data_store.data): - self.data_store.data = self.multiline_regex_pattern.split( - self.data_store.data + self.data_store.data = list( + filter( + None, self.multiline_regex_pattern.split(self.data_store.data) + ) ) else: self.logger.debug(