Parent

Methods

Included Modules

Class/Module Index [+]

Quicksearch

Fluent::TextParser::JSONParser

Public Instance Methods

call(text) click to toggle source
# File lib/fluent/parser.rb, line 72
def call(text)
  record = Yajl.load(text)

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

  return time, record
rescue Yajl::ParseError
  $log.warn "pattern not match: #{text.inspect}: #{$!}"
  return nil, nil
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.