Skip to content

Commit

Permalink
Fluentd: guard against nil values when sanitizing labels (#1376)
Browse files Browse the repository at this point in the history
* Guard against nil values when sanitizing labels

* Gem version bump
  • Loading branch information
jstaffans authored and cyriltovena committed Dec 5, 2019
1 parent 3ffa385 commit 7b2fde3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $LOAD_PATH.push File.expand_path('lib', __dir__)

Gem::Specification.new do |spec|
spec.name = 'fluent-plugin-grafana-loki'
spec.version = '1.2.4'
spec.version = '1.2.5'
spec.authors = %w[woodsaj briangann cyriltovena]
spec.email = ['awoods@grafana.com', 'brian@grafana.com' , 'cyril.tovena@grafana.com']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def format_labels(data_labels)
data_labels = {} if data_labels.nil?
data_labels = data_labels.merge(@extra_labels)
# sanitize label values
data_labels.each { |k, v| formatted_labels[k] = v.gsub('"', '\\"') }
data_labels.each { |k, v| formatted_labels[k] = v.gsub('"', '\\"') if v }
formatted_labels
end

Expand Down

0 comments on commit 7b2fde3

Please sign in to comment.