class LogStash::Outputs::Riemann
Riemann
is a network event stream processing system.
While Riemann
is very similar conceptually to Logstash, it has much more in terms of being a monitoring system replacement.
Riemann
is used in Logstash much like statsd or other metric-related outputs
You can learn about Riemann
here:
-
<riemann.io/>
You can see the author talk about it here:
Public Instance Methods
receive(event)
click to toggle source
# File lib/logstash/outputs/riemann.rb, line 81 def receive(event) return unless output?(event) # Let's build us an event, shall we? r_event = Hash.new r_event[:host] = event.sprintf(@sender) # riemann doesn't handle floats so we reduce the precision here r_event[:time] = event["@timestamp"].to_i r_event[:description] = event["message"] if @riemann_event @riemann_event.each do |key, val| if ["ttl","metric"].include?(key) r_event[key.to_sym] = event.sprintf(val).to_f else r_event[key.to_sym] = event.sprintf(val) end end end r_event[:tags] = event["tags"] if event["tags"].is_a?(Array) @logger.debug("Riemann event: ", :riemann_event => r_event) begin proto_client = @client.instance_variable_get("@#{@protocol}") @logger.debug("Riemann client proto: #{proto_client.to_s}") proto_client << r_event rescue Exception => e @logger.debug("Unhandled exception", :error => e) end end
register()
click to toggle source
# File lib/logstash/outputs/riemann.rb, line 75 def register require 'riemann/client' @client = Riemann::Client.new(:host => @host, :port => @port) end