Skip to content

Instantly share code, notes, and snippets.

@doryokujin
Created October 9, 2011 17:04
Show Gist options
  • Save doryokujin/1273920 to your computer and use it in GitHub Desktop.
Save doryokujin/1273920 to your computer and use it in GitHub Desktop.
include time in fluent out_plugin
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