Skip to content

Commit 82530ed

Browse files
authored
feat: log warning if log_key does not exist in log (#86)
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
1 parent 835e3b2 commit 82530ed

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/fluent/plugin/out_sumologic.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,9 @@ def write(chunk)
367367
when 'logs'
368368
case log_format
369369
when 'text'
370+
if !record.has_key?(@log_key)
371+
log.warn "log key `#{@log_key}` has not been found in the log"
372+
end
370373
log = log_to_str(record[@log_key])
371374
when 'json_merge'
372375
if @add_timestamp

0 commit comments

Comments
 (0)