Skip to content

Commit

Permalink
update log_type field to be ignored if value is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
markdboyd committed Dec 20, 2024
1 parent 8e58ed6 commit 3edf96e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/logstash/inputs/cloudwatch_logs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ def map_group_to_log_type(group)
'opensearch'
when %r{/aws/ElasticCache/.*}i
'elasticache'
else
'unknown log type'
end
end

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3edf96e

Please sign in to comment.