Class: LogStash::Inputs::Example

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

Overview

Generate a repeating message.

This plugin is intented only as an example.

Instance Method Summary collapse

Instance Method Details

#registerObject



26
27
28
# File 'lib/logstash/inputs/example.rb', line 26

def register
  @host = Socket.gethostname
end

#run(queue) ⇒ Object

def register



30
31
32
33
34
35
36
# File 'lib/logstash/inputs/example.rb', line 30

def run(queue)
  Stud.interval(@interval) do
    event = LogStash::Event.new("message" => @message, "host" => @host)
    decorate(event)
    queue << event
  end # loop

end