mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
- refactor now that @timestamp is a Time object
This commit is contained in:
parent
9b8162c204
commit
05ab32f47e
1 changed files with 2 additions and 2 deletions
|
@ -52,9 +52,9 @@ class LogStash::Outputs::Mongodb < LogStash::Outputs::Base
|
|||
if @isodate
|
||||
# the mongodb driver wants time values as a ruby Time object.
|
||||
# set the @timestamp value of the document to a ruby Time object, then.
|
||||
document = event.to_hash.merge("@timestamp" => event.ruby_timestamp)
|
||||
else
|
||||
document = event.to_hash
|
||||
else
|
||||
document = event.to_hash.merge("@timestamp" => event["@timestamp"].to_json)
|
||||
end
|
||||
if @generateId
|
||||
document['_id'] = BSON::ObjectId.new(nil, event.ruby_timestamp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue