fluentd-plugin: call gsub for strings only (#1475)

* Use gsub only for string variables

* Delete version change
pull/1493/head^2
Matej 6 years ago committed by Cyril Tovena
parent 7c4906786d
commit aa09aa5f34
  1. 2
      fluentd/fluent-plugin-grafana-loki/lib/fluent/plugin/out_loki.rb

@ -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('"', '\\"') if v }
data_labels.each { |k, v| formatted_labels[k] = v.gsub('"', '\\"') if v && v&.is_a?(String) }
formatted_labels
end

Loading…
Cancel
Save