lib/fluent/plugin/in_kafka.rb in fluent-plugin-kafka-0.6.6 vs lib/fluent/plugin/in_kafka.rb in fluent-plugin-kafka-0.7.0
- old
+ new
@@ -106,10 +106,14 @@
require 'zookeeper' if @offset_zookeeper
@parser_proc = setup_parser
if @use_record_time and @time_format
- @time_parser = Fluent::TextParser::TimeParser.new(@time_format)
+ if defined?(Fluent::TimeParser)
+ @time_parser = Fluent::TimeParser.new(@time_format)
+ else
+ @time_parser = Fluent::TextParser::TimeParser.new(@time_format)
+ end
end
end
def setup_parser
case @format