From 62f39154b9faa63caead11d26823c861c13b6b71 Mon Sep 17 00:00:00 2001 From: David Warden Date: Tue, 11 Jun 2013 10:04:58 -0400 Subject: [PATCH] added set metric output --- lib/logstash/outputs/statsd.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/logstash/outputs/statsd.rb b/lib/logstash/outputs/statsd.rb index 5903395eb..ae46a4596 100644 --- a/lib/logstash/outputs/statsd.rb +++ b/lib/logstash/outputs/statsd.rb @@ -52,6 +52,9 @@ class LogStash::Outputs::Statsd < LogStash::Outputs::Base # A count metric. metric_name => count as hash config :count, :validate => :hash, :default => {} + # A set metric. metric_name => string to append as hash + config :set, :validate => :hash, :default => {} + # The sample rate for the metric config :sample_rate, :validate => :number, :default => 1 @@ -90,6 +93,10 @@ class LogStash::Outputs::Statsd < LogStash::Outputs::Base @client.timing(build_stat(event.sprintf(metric), sender), event.sprintf(val).to_f, @sample_rate) end + @set.each do |metric, val| + @client.set(build_stat(event.sprintf(metric), sender), + event.sprintf(val), @sample_rate) + end end # def receive def build_stat(metric, sender=@sender)