From 3edf96ecc805cbb28689de3aee82c87d683f0ccb Mon Sep 17 00:00:00 2001 From: Mark Boyd Date: Fri, 20 Dec 2024 16:12:02 -0500 Subject: [PATCH] update log_type field to be ignored if value is nil --- lib/logstash/inputs/cloudwatch_logs.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/logstash/inputs/cloudwatch_logs.rb b/lib/logstash/inputs/cloudwatch_logs.rb index c3ca546..ddeb59c 100644 --- a/lib/logstash/inputs/cloudwatch_logs.rb +++ b/lib/logstash/inputs/cloudwatch_logs.rb @@ -173,8 +173,6 @@ def map_group_to_log_type(group) 'opensearch' when %r{/aws/ElasticCache/.*}i 'elasticache' - else - 'unknown log type' end end @@ -248,7 +246,7 @@ def process_log(log, group, log_type) event.set('[cloudwatch_logs][log_stream]', log.log_stream_name) event.set('[cloudwatch_logs][event_id]', log.event_id) event.set('[cloudwatch_logs][tags]', tags) - event.set('[cloudwatch_logs][log_type]', log_type) + event.set('[cloudwatch_logs][log_type]', log_type) unless log_type.nil? decorate(event) @queue << event