Included Modules

Class/Module Index [+]

Quicksearch

Fluent::SetTimeKeyMixin

Attributes

include_time_key[RW]
localtime[RW]
time_key[RW]

Public Instance Methods

configure(conf) click to toggle source
# File lib/fluent/mixin.rb, line 120
def configure(conf)
  super

  @include_time_key = false

  if s = conf['include_time_key']
    include_time_key = Config.bool_value(s)
    raise ConfigError, "Invalid boolean expression '#{s}' for include_time_key parameter" if include_time_key.nil?

    @include_time_key = include_time_key
  end

  if @include_time_key
    @time_key     = conf['time_key'] || 'time'
    @time_format  = conf['time_format']

    if    conf['localtime']
      @localtime = true
    elsif conf['utc']
      @localtime = false
    end

    @timef = TimeFormatter.new(@time_format, @localtime)
  end
end
filter_record(tag, time, record) click to toggle source
# File lib/fluent/mixin.rb, line 146
def filter_record(tag, time, record)
  super

  record[@time_key] = @timef.format(time) if @include_time_key
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.