class LogStash::Outputs::Ganglia
This output allows you to pull metrics from your logs and ship them to ganglia's gmond. This is heavily based on the graphite output.
Public Instance Methods
receive(event)
click to toggle source
# File lib/logstash/outputs/ganglia.rb, line 50 def receive(event) return unless output?(event) # gmetric only takes integer values, so convert it to int. case @metric_type when "string" localvalue = event.sprintf(@value) when "float" localvalue = event.sprintf(@value).to_f when "double" localvalue = event.sprintf(@value).to_f else # int8|uint8|int16|uint16|int32|uint32 localvalue = event.sprintf(@value).to_i end Ganglia::GMetric.send(@host, @port, { :name => event.sprintf(@metric), :units => @units, :type => @metric_type, :value => localvalue, :group => @group, :slope => @slope, :tmax => @max_interval, :dmax => @lifetime }) end
register()
click to toggle source
# File lib/logstash/outputs/ganglia.rb, line 45 def register require "gmetric" end