Parent

Included Modules

Class/Module Index [+]

Quicksearch

Fluent::TextParser::ValuesParser

Public Instance Methods

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

  @keys = @keys.split(",")

  if @time_key && !@keys.include?(@time_key)
    raise ConfigError, "time_key (#{@time_key.inspect}) is not included in keys (#{@keys.inspect})"
  end

  if @time_format && !@time_key
    raise ConfigError, "time_format parameter is ignored because time_key parameter is not set. at #{conf.inspect}"
  end
end
values_map(values) click to toggle source
# File lib/fluent/parser.rb, line 113
def values_map(values)
  record = Hash[keys.zip(values)]

  if @time_key
    value = record.delete(@time_key)
    if @time_format
      time = Time.strptime(value, @time_format).to_i
    else
      time = Time.parse(value).to_i
    end
  else
    time = Engine.now
  end

  return time, record
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.