Class: LogStash::Inputs::Stdin

Inherits:
Base
  • Object
show all
Defined in:
lib/logstash/inputs/stdin.rb

Defined Under Namespace

Classes: InputHandler

Instance Attribute Summary

Attributes inherited from Base

#logger

Instance Method Summary collapse

Methods inherited from Base

#initialize, #tag

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

#registerObject



8
9
10
11
# File 'lib/logstash/inputs/stdin.rb', line 8

def register
  EventMachine::attach($stdin, InputHandler, self)
  @url.host = Socket.gethostname
end