Class: LogStash::Outputs::Courier

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

Overview

Send events using the Log Courier protocol

Instance Method Summary collapse

Instance Method Details

#closeObject

Logstash >= 2.0.0 shutdown



78
79
80
81
82
# File 'lib/logstash/outputs/courier.rb', line 78

def close
  @client.shutdown
  finished
  nil
end

#receive(event) ⇒ Object



67
68
69
70
# File 'lib/logstash/outputs/courier.rb', line 67

def receive(event)
  return unless output?(event)
  @client.publish event.to_hash
end

#registerObject



60
61
62
63
64
65
# File 'lib/logstash/outputs/courier.rb', line 60

def register
  @logger.info 'Starting courier output'

  require 'log-courier/client'
  @client = LogCourier::Client.new(options)
end

#teardownObject

Logstash < 2.0.0 shutdown



73
74
75
# File 'lib/logstash/outputs/courier.rb', line 73

def teardown
  close
end