Class: LogStash::Inputs::Courier
- Inherits:
-
Base
- Object
- Base
- LogStash::Inputs::Courier
- Defined in:
- lib/logstash/inputs/courier.rb
Overview
Receive events over the Log Courier protocol
Instance Method Summary collapse
- #register ⇒ Object
-
#run(output_queue) ⇒ Object
Logstash < 2.0.0 shutdown raises LogStash::ShutdownSignal in this thread The exception implicitly stops the log-courier gem using an ensure block and is then caught by the pipeline worker - so we needn’t do anything here.
- #stop ⇒ Object
Instance Method Details
#register ⇒ Object
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/logstash/inputs/courier.rb', line 72 def register require 'log-courier/server' @log_courier = LogCourier::Server.new @logger.info( 'Started courier input listener', address: "#{@host}:#{@port}", ) nil end |
#run(output_queue) ⇒ Object
Logstash < 2.0.0 shutdown raises LogStash::ShutdownSignal in this thread The exception implicitly stops the log-courier gem using an ensure block and is then caught by the pipeline worker - so we needn’t do anything here
86 87 88 89 90 91 92 93 94 |
# File 'lib/logstash/inputs/courier.rb', line 86 def run(output_queue) @log_courier.run do |event| event['tags'] = [event['tags']] if event.key?('tags') && !event['tags'].is_a?(Array) event = LogStash::Event.new(event) decorate event output_queue << event end nil end |
#stop ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/logstash/inputs/courier.rb', line 96 def stop @logger.info( 'Stopping courier input listener', address: "#{@host}:#{@port}", ) @log_courier.stop @logger.info( 'Stopped courier input listener', address: "#{@host}:#{@port}", ) nil end |