Skip to content

Commit

Permalink
in_http: Check the keep_time_key flag only when it's really needed.
Browse files Browse the repository at this point in the history
Pointed out by repeatedly in the patch review. See the conversation
in the following ticket for details:

    #2020

Signed-off-by: Fujimoto Seiji <[email protected]>
  • Loading branch information
Fujimoto Seiji committed Jun 18, 2018
1 parent 6d61cfb commit 39f3a0d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/fluent/plugin/in_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,14 @@ def on_request(path_info, params)

if single_record.has_key?('time')
single_time = Fluent::EventTime.from_time(Time.at(single_record['time']))

unless @parser and @parser.keep_time_key
single_record.delete('time')
end
else
single_time = time
end

unless @parser and @parser.keep_time_key
single_record.delete('time')
end

mes.add(single_time, single_record)
end
router.emit_stream(tag, mes)
Expand Down

0 comments on commit 39f3a0d

Please sign in to comment.