Class: LogStash::Inputs::Websocket
- Inherits:
-
Base
- Object
- Base
- LogStash::Inputs::Websocket
- Defined in:
- lib/logstash/inputs/websocket.rb
Overview
Read events over the websocket protocol.
Instance Method Summary collapse
Instance Method Details
#register ⇒ Object
26 27 28 |
# File 'lib/logstash/inputs/websocket.rb', line 26 def register require "ftw" end |
#run(output_queue) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/logstash/inputs/websocket.rb', line 31 def run(output_queue) # TODO(sissel): Implement server mode. agent = FTW::Agent.new begin websocket = agent.websocket!(@url) websocket.each do |payload| @codec.decode(payload) do |event| decorate(event) output_queue << event end end rescue => e @logger.warn("websocket input client threw exception, restarting", :exception => e) sleep(1) retry end # begin end |