Skip to content

Commit

Permalink
fix JSONParser compatible with older versions to allow configure just…
Browse files Browse the repository at this point in the history
… time_format
  • Loading branch information
tagomoris committed Oct 24, 2016
1 parent b12ed03 commit e44dbab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/fluent/plugin/parser_json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ class JSONParser < Parser
config_set_default :time_key, 'time'
config_param :json_parser, :enum, list: [:oj, :yajl, :json], default: :oj

config_set_default :time_type, :float

def configure(conf)
if conf.has_key?('time_format')
conf['time_type'] ||= 'string'
end

super
@load_proc, @error_class = configure_json_parser(@json_parser)
end
Expand Down

0 comments on commit e44dbab

Please sign in to comment.