Class: LogStash::Inputs::Websocket
- Defined in:
- lib/logstash/inputs/websocket.rb
Overview
Read events over the websocket protocol.
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
Methods inherited from Base
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::Inputs::Base
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 |