Class: LogStash::Outputs::Internal
- Defined in:
- lib/logstash/outputs/internal.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #callback(&block) ⇒ Object
- #callback=(proc_block) ⇒ Object
-
#initialize(url, config = {}, &block) ⇒ Internal
constructor
A new instance of Internal.
- #receive(event) ⇒ Object
- #register ⇒ Object
Constructor Details
#initialize(url, config = {}, &block) ⇒ Internal
Returns a new instance of Internal.
6 7 8 9 |
# File 'lib/logstash/outputs/internal.rb', line 6 def initialize(url, config={}, &block) super @callback = block end |
Instance Method Details
#callback(&block) ⇒ Object
27 28 29 |
# File 'lib/logstash/outputs/internal.rb', line 27 def callback(&block) @callback = block end |
#callback=(proc_block) ⇒ Object
33 34 35 |
# File 'lib/logstash/outputs/internal.rb', line 33 def callback=(proc_block) @callback = proc_block end |
#receive(event) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/logstash/outputs/internal.rb', line 17 def receive(event) if !@callback @logger.error("No callback for output #{@url}, cannot receive") return end @callback.call(event) end |
#register ⇒ Object
12 13 14 |
# File 'lib/logstash/outputs/internal.rb', line 12 def register @logger.info("Registering output #{@url}") end |