Class: LogStash::Outputs::UDP
- Defined in:
- lib/logstash/outputs/udp.rb
Overview
Send events over UDP
Keep in mind that UDP will lose messages.
Constant Summary
Constants included from Config::Mixin
Instance Attribute Summary
Attributes included from Config::Mixin
Attributes inherited from Plugin
Instance Method Summary collapse
Methods inherited from Base
#handle, #handle_worker, #initialize, #worker_setup, #workers_not_supported
Methods included from Config::Mixin
Methods inherited from Plugin
#eql?, #finished, #finished?, #hash, #initialize, #inspect, lookup, #reload, #running?, #shutdown, #teardown, #terminating?, #to_s
Constructor Details
This class inherits a constructor from LogStash::Outputs::Base
Instance Method Details
#receive(event) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/logstash/outputs/udp.rb', line 29 def receive(event) return unless output?(event) if event == LogStash::SHUTDOWN finished return end @codec.encode(event) end |
#register ⇒ Object
22 23 24 25 26 27 |
# File 'lib/logstash/outputs/udp.rb', line 22 def register @socket = UDPSocket.new @codec.on_event do |payload| @socket.send(payload, 0, @host, @port) end end |