Created
October 9, 2011 17:04
-
-
Save doryokujin/1273920 to your computer and use it in GitHub Desktop.
include time in fluent out_plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'time' | |
... | |
def format(tag, event) | |
record = event.record.dup | |
# if you use a timestamp | |
timestamp = event.time | |
record['timestamp'] = timestamp | |
# if you use a time | |
time_obj = Time.at(event.time) | |
record['time'] = time_obj | |
return record.to_msgpack | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment