Class: LogStash::Inputs::Stdin
- Defined in:
- lib/logstash/inputs/stdin.rb
Defined Under Namespace
Classes: InputHandler
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from LogStash::Inputs::Base
Instance Method Details
#receive(event) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/logstash/inputs/stdin.rb', line 14 def receive(event) event = LogStash::Event.new({ "@message" => event, "@type" => @type, "@tags" => @tags.clone, }) event.source = @url @logger.debug(["Got event", event]) @callback.call(event) end |
#register ⇒ Object
8 9 10 11 |
# File 'lib/logstash/inputs/stdin.rb', line 8 def register EventMachine::attach($stdin, InputHandler, self) @url.host = Socket.gethostname end |