lib/logstash/inputs/internal.rb in logstash-lite-0.2.20101222161646 vs lib/logstash/inputs/internal.rb in logstash-lite-0.2.20110112115019
- old
+ new
@@ -1,27 +1,30 @@
-
-require "logstash/inputs/base"
require "eventmachine-tail"
+require "logstash/inputs/base"
+require "logstash/namespace"
require "socket" # for Socket.gethostname
class LogStash::Inputs::Internal < LogStash::Inputs::Base
attr_reader :channel
+ public
def initialize(url, type, config={}, &block)
super
# Default host to the machine's hostname if it's not set
@url.host ||= Socket.gethostname
@channel = EventMachine::Channel.new
end
+ public
def register
@logger.info("Registering input #{@url}")
@channel.subscribe do |event|
receive(event)
end
end # def register
+ public
def receive(event)
if !event.is_a?(LogStash::Event)
event = LogStash::Event.new({
"@message" => event,
"@type" => @type,