Class: LogStash::Inputs::Gelf
- Defined in:
- lib/logstash/inputs/gelf.rb
Overview
Read gelf messages as events over the network.
This input is a good choice if you already use graylog2 today.
The main reasoning for this input is to leverage existing GELF logging libraries such as the gelf log4j appender
Constant Summary
Constants included from Config::Mixin
Instance Attribute Summary
Attributes inherited from Base
Attributes included from Config::Mixin
Attributes inherited from Plugin
Instance Method Summary collapse
-
#initialize(params) ⇒ Gelf
constructor
A new instance of Gelf.
- #register ⇒ Object
- #run(output_queue) ⇒ Object
Methods inherited from Base
Methods included from Config::Mixin
Methods inherited from Plugin
#eql?, #finished, #finished?, #hash, #inspect, lookup, #reload, #running?, #shutdown, #teardown, #terminating?, #to_s
Constructor Details
#initialize(params) ⇒ Gelf
Returns a new instance of Gelf.
48 49 50 51 |
# File 'lib/logstash/inputs/gelf.rb', line 48 def initialize(params) super BasicSocket.do_not_reverse_lookup = true end |
Instance Method Details
#register ⇒ Object
54 55 56 57 |
# File 'lib/logstash/inputs/gelf.rb', line 54 def register require 'gelfd' @udp = nil end |
#run(output_queue) ⇒ Object
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/logstash/inputs/gelf.rb', line 60 def run(output_queue) begin # udp server udp_listener(output_queue) rescue => e @logger.warn("gelf listener died", :exception => e, :backtrace => e.backtrace) sleep(5) retry end # begin end |