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 16
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 29
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 40
def modify_record(time, record)
  if record[@msec_key] then
    record[@timestamp_key] = Time.at(time, record[@msec_key].to_i * 1000).strftime("%Y-%m-%dT%H:%M:%S.%L%z")
    record.delete(@msec_key)
  end
  record
end