19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/fluent/plugin/in_aes_forward.rb', line 19
def on_message(msg)
if msg.nil?
return
end
tag = msg[0].to_s
entries = decrypt_data(msg[1])
if entries.class == String
es = MessagePackEventStream.new(entries, @cached_unpacker)
Engine.emit_stream(tag, es)
elsif entries.class == Array
es = MultiEventStream.new
entries.each {|e|
record = e[1]
next if record.nil?
time = e[0].to_i
time = (now ||= Engine.now) if time == 0
es.add(time, record)
}
Engine.emit_stream(tag, es)
else
record = msg[2]
return if record.nil?
time = msg[1]
time = Engine.now if time == 0
Engine.emit(tag, time, record)
end
end
|