class Fluent::BetterTimestampOutput
Constants
- BUILTIN_CONFIGURATIONS
Public Instance Methods
configure(conf)
click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_better_timestamp.rb, line 17 def configure(conf) super @map = {} conf.each_pair { |k, v| unless BUILTIN_CONFIGURATIONS.include?(k) conf.has_key?(k) @map[k] = v end } end
emit(tag, es, chain)
click to toggle source
# File lib/fluent/plugin/out_better_timestamp.rb, line 30 def emit(tag, es, chain) es.each { |time, record| filter_record(tag, time, record) Engine.emit(@tag, time, modify_record(time, record)) } chain.next end
Private Instance Methods
modify_record(time, record)
click to toggle source
# File lib/fluent/plugin/out_better_timestamp.rb, line 41 def modify_record(time, record) if record[@msec_key] then record[@timestamp_key] = Time.at(record[@time_key].to_i, record[@msec_key].to_i * 1000).strftime("%Y-%m-%dT%H:%M:%S.%L%z") record.delete(@msec_key) end record end