Class: FluentExt::TextParser::GenericParser

Inherits:
Object
  • Object
show all
Includes:
Fluent::Configurable
Defined in:
lib/fluent/plugin/fixed_parser.rb

Direct Known Subclasses

JSONParser, LabeledTSVParser, ValuesParser

Instance Method Summary collapse

Instance Method Details

#parse_time(record) ⇒ Object



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/fluent/plugin/fixed_parser.rb', line 59

def parse_time(record)
  time = nil
  if value = record.delete(@time_key)
    time = if @time_format
             Time.strptime(value, @time_format).to_i
           else
             Time.parse(value).to_i
           end
  end
  return time, record
end