Skip to content

Commit 9198a2d

Browse files
committed
use event time for plugin added time
1 parent abc120a commit 9198a2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/fluent/plugin/filter_elasticsearch_timestamp_check.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def filter(tag, time, record)
6363

6464
unless record['fluent_converted_timestamp']
6565
record['@timestamp'] = record['fluent_added_timestamp'] =
66-
Time.now.strftime(@strftime_format)
66+
Time.at(time.is_a?(Fluent::EventTime) ? time.to_int : time).strftime(@strftime_format)
6767
$log.debug("Timestamp added: #{record['@timestamp']}")
6868
end
6969

0 commit comments

Comments
 (0)