Class: Fluent::Plugin::PingMessageInput

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_ping_message.rb

Instance Method Summary collapse

Instance Method Details

#configure(conf) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/fluent/plugin/in_ping_message.rb', line 14

def configure(conf)
  super

  if @data.include?('${hostname}')
    @hostname ||= Socket.gethostname
    @data.gsub!('${hostname}', @hostname)
  end
end

#multi_workers_ready?Boolean

Returns:



23
24
25
# File 'lib/fluent/plugin/in_ping_message.rb', line 23

def multi_workers_ready?
  true
end

#startObject



27
28
29
30
31
32
33
34
# File 'lib/fluent/plugin/in_ping_message.rb', line 27

def start
  super
  timer_execute(:in_ping_message_pingpong, @interval) do
    now = Fluent::Engine.now
    record = inject_values_to_record(@tag, now, {'data' => @data})
    router.emit(@tag, now, record)
  end
end