Class: Fluent::RavenDecoderOutput

Inherits:
Output
  • Object
show all
Defined in:
lib/fluent/plugin/out_raven_decoder.rb

Instance Method Summary collapse

Constructor Details

#initializeRavenDecoderOutput



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

def initialize
  super
  require 'base64'
  require 'zlib'
  require 'multi_json'
end

Instance Method Details

#configure(conf) ⇒ Object



31
32
33
# File 'lib/fluent/plugin/out_raven_decoder.rb', line 31

def configure(conf)
  super
end

#emit(tag, es, chain) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/fluent/plugin/out_raven_decoder.rb', line 35

def emit(tag, es, chain)
  new_tag = @prefix + '.' + tag

  es.each do |time, record|
    data = record[@data_field]

    if data
      data = decode(data)
      router.emit(new_tag, time, data)
    else
      log.warn("Raven data is not included: tag:#{new_tag} record:#{record.inspect}")
    end
  end

  chain.next
rescue => e
  log.error(e.message + "\n" + e.backtrace.first)
end

#shutdownObject



27
28
29
# File 'lib/fluent/plugin/out_raven_decoder.rb', line 27

def shutdown
  super
end

#startObject



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

def start
  super
end