Class: Fluent::HostnameOutput

Inherits:
Output
  • Object
show all
Includes:
SetTagKeyMixin, SetTimeKeyMixin
Defined in:
lib/fluent/plugin/out_hostname.rb

Instance Method Summary collapse

Instance Method Details

#configure(conf) ⇒ Object



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

def configure(conf)
  super

  if @key_name.empty?
    raise Fluent::ConfigError, "key_name is must not be specified"
  end
end

#emit(tag, es, chain) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/fluent/plugin/out_hostname.rb', line 23

def emit(tag, es, chain)
  es.each do |time,record|
    record[@key_name] = @host 
    Fluent::Engine.emit(tag, time, record)
  end

  chain.next
end