lib/fluent/plugin/out_mysql_bulk.rb in fluent-plugin-mysql-bulk-0.0.3 vs lib/fluent/plugin/out_mysql_bulk.rb in fluent-plugin-mysql-bulk-0.0.4
- old
+ new
@@ -44,10 +44,10 @@
@on_duplicate_key_update_sql += updates.join(',')
end
@column_names = @column_names.split(',')
@key_names = @key_names.nil? ? @column_names : @key_names.split(',')
- @format_proc = Proc.new{|tag, time, record| @key_names.map{|k| record[k]}}
+ @format_proc = Proc.new{|tag, time, record| @key_names.map{|k| k == '${time}' ? Time.at(time).strftime("%Y-%m-%d %H:%M:%S") : record[k]}}
end
def start
super