Class: LogStash::Outputs::Base
- Inherits:
-
Object
- Object
- LogStash::Outputs::Base
- Defined in:
- lib/logstash/outputs/base.rb
Direct Known Subclasses
Amqp, Beanstalk, Elasticsearch, Gelf, Internal, Mongodb, Nagios, Redis, Stdout, Stomp, Tcp, Websocket
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(url, config = {}, &block) ⇒ Base
constructor
A new instance of Base.
- #receive(event) ⇒ Object
- #register ⇒ Object
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
#logger ⇒ Object
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 |
#register ⇒ Object
26 27 28 |
# File 'lib/logstash/outputs/base.rb', line 26 def register raise "#{self.class}#register must be overidden" end |