Skip to content

Commit

Permalink
fluentd-plugin-grafana-loki: avoid exception when remove/label_keys i…
Browse files Browse the repository at this point in the history
…s unset

Fixes grafana#749

Signed-off-by: Brian Candler <b.candler@pobox.com>
  • Loading branch information
candlerb committed Jul 14, 2019
1 parent d5688b5 commit af07a42
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ def line_to_loki(record)
# remove needless keys.
@remove_keys.each { |v|
record.delete(v)
}
} if @remove_keys
# extract white listed record keys into labels.
@label_keys.each do |k|
if record.key?(k)
chunk_labels[k] = record[k]
record.delete(k)
end
end
end if @label_keys
line = record_to_line(record)
else
line = record.to_s
Expand Down

0 comments on commit af07a42

Please sign in to comment.