lib/logstash/outputs/graphite.rb in logstash-output-graphite-2.0.5 vs lib/logstash/outputs/graphite.rb in logstash-output-graphite-3.0.0

- old
+ new

@@ -168,15 +168,15 @@ metrics_lines_for_event(event, metric, value, timestamp) end end def event_timestamp(event) - event[@timestamp_field].to_i + event.get(@timestamp_field).to_i end def metrics_lines_for_event(event, metric, value, timestamp) - if event[metric].is_a?(Hash) - dotify(event[metric], metric).map do |k, v| + if event.get(metric).is_a?(Hash) + dotify(event.get(metric), metric).map do |k, v| metrics_line(event, k, v, timestamp) end else metrics_line(event, event.sprintf(metric), event.sprintf(value).to_f, timestamp) end