Class: Fluent::Plugin::FlattenHashOutput

Inherits:
Output
  • Object
show all
Includes:
FlattenHashUtil, HandleTagNameMixin
Defined in:
lib/fluent/plugin/out_flatten_hash.rb

Instance Method Summary collapse

Methods included from FlattenHashUtil

#flatten_record

Instance Method Details

#configure(conf) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/fluent/plugin/out_flatten_hash.rb', line 17

def configure(conf)
  super
  if (!@tag &&
      !remove_tag_prefix &&
      !remove_tag_suffix &&
      !add_tag_prefix &&
      !add_tag_suffix )
    raise Fluent::ConfigError, "out_flatten_hash: No tag parameters are set"
  end
end

#multi_workers_ready?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/fluent/plugin/out_flatten_hash.rb', line 28

def multi_workers_ready?
  true
end

#process(tag, es) ⇒ Object



32
33
34
35
36
37
38
39
40
# File 'lib/fluent/plugin/out_flatten_hash.rb', line 32

def process(tag, es)
  tag = @tag || tag
  es.each do |time, record|
    record = flatten_record(record, [])
    t = tag.dup
    filter_record(t, time, record)
    router.emit(t, time, record)
  end
end