Class: LogStash::Inputs::Udp
- Defined in:
- lib/logstash/inputs/udp.rb
Overview
Read messages as events over the network via udp.
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) ⇒ Udp
constructor
A new instance of Udp.
- #register ⇒ Object
- #run(output_queue) ⇒ Object
- #teardown ⇒ Object
Methods inherited from Base
Methods included from Config::Mixin
Methods inherited from Plugin
#eql?, #finished, #finished?, #hash, #inspect, lookup, #reload, #running?, #shutdown, #terminating?, #to_s
Constructor Details
#initialize(params) ⇒ Udp
Returns a new instance of Udp.
26 27 28 29 |
# File 'lib/logstash/inputs/udp.rb', line 26 def initialize(params) super BasicSocket.do_not_reverse_lookup = true end |
Instance Method Details
#register ⇒ Object
32 33 34 |
# File 'lib/logstash/inputs/udp.rb', line 32 def register @udp = nil end |
#run(output_queue) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/logstash/inputs/udp.rb', line 37 def run(output_queue) begin # udp server udp_listener(output_queue) rescue LogStash::ShutdownSignal # do nothing, shutdown was requested. rescue => e @logger.warn("UDP listener died", :exception => e, :backtrace => e.backtrace) sleep(5) retry end # begin end |
#teardown ⇒ Object
77 78 79 |
# File 'lib/logstash/inputs/udp.rb', line 77 def teardown @udp.close if @udp && !@udp.closed? end |