Fluentd: guard against nil values when sanitizing labels (#1376)

* Guard against nil values when sanitizing labels

* Gem version bump
pull/1381/head
Johannes Staffans 6 years ago committed by Cyril Tovena
parent 3ffa385b1e
commit 7b2fde3e58
  1. 2
      fluentd/fluent-plugin-grafana-loki/fluent-plugin-grafana-loki.gemspec
  2. 2
      fluentd/fluent-plugin-grafana-loki/lib/fluent/plugin/out_loki.rb

@ -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']

@ -195,7 +195,7 @@ module Fluent
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

Loading…
Cancel
Save