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/fluent-plugin-grafana-loki.gemspec
  2. 2
      fluentd/fluent-plugin-grafana-loki/lib/fluent/plugin/out_loki.rb

@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
spec.name = 'fluent-plugin-grafana-loki'
spec.version = '1.2.5'
spec.authors = %w[woodsaj briangann cyriltovena]
spec.email = ['awoods@grafana.com', 'brian@grafana.com' , 'cyril.tovena@grafana.com']
spec.email = ['awoods@grafana.com', 'brian@grafana.com', 'cyril.tovena@grafana.com']
spec.summary = 'Output plugin to ship logs to a Grafana Loki server'
spec.description = 'Output plugin to ship logs to a Grafana Loki server'

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