logstash/logstash — pull request #223 by kamorin (2012-10-18 18:12:10+00:00)
Title: MongoDB output Datetime support

MongoDB 2.2 has a number of interesting features, one of which is the ability to expire data from a collection based on timestamp (TTL). This feature however only works if the field is of datatime type.

@timestamp field is being stored as a string. We need it as a Datetime type so mongo stores it and processes it correctly.

in this commit I am replacing the @timestamp string with current time (Time.now). We could also just parse the string into Datetime type. I did not do this as in the events.rb file it mentions how slow time parsing is in jruby, of course I am willing to if it's suggested.