Class: LogStash::Outputs::UDP

Inherits:
Base
  • Object
show all
Defined in:
lib/logstash/outputs/udp.rb

Overview

Send events over UDP

Keep in mind that UDP will lose messages.

Instance Method Summary collapse

Instance Method Details

#receive(event) ⇒ Object



28
29
30
31
32
# File 'lib/logstash/outputs/udp.rb', line 28

def receive(event)
  
  return if event == LogStash::SHUTDOWN
  @codec.encode(event)
end

#registerObject



21
22
23
24
25
26
# File 'lib/logstash/outputs/udp.rb', line 21

def register
  @socket = UDPSocket.new
  @codec.on_event do |event, payload|
    @socket.send(payload, 0, @host, @port)
  end
end