Class: LogStash::Outputs::Base

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, config = {}, &block) ⇒ Base

Returns a new instance of Base.



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/logstash/outputs/base.rb', line 11

def initialize(url, config={}, &block)
  @url = url
  @url = URI.parse(url) if url.is_a? String
  @config = config
  @logger = LogStash::Logger.new(STDOUT)
  @urlopts = {}
  if @url.query
    @urlopts = CGI.parse(@url.query)
    @urlopts.each do |k, v|
      @urlopts[k] = v.last if v.is_a?(Array)
    end
  end
end

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



8
9
10
# File 'lib/logstash/outputs/base.rb', line 8

def logger
  @logger
end

Instance Method Details

#receive(event) ⇒ Object



31
32
33
# File 'lib/logstash/outputs/base.rb', line 31

def receive(event)
  raise "#{self.class}#receive must be overidden"
end

#registerObject



26
27
28
# File 'lib/logstash/outputs/base.rb', line 26

def register
  raise "#{self.class}#register must be overidden"
end