[Groonga-commit] groonga/fluent-plugin-groonga-log at b1491f7 [master] Set Time#iso8601 instead of Time object into record

Back to archive index

Kentaro Hayashi null+****@clear*****
Mon Oct 16 16:46:10 JST 2017


Kentaro Hayashi	2017-10-16 16:46:10 +0900 (Mon, 16 Oct 2017)

  New Revision: b1491f7bd9167f0bef25583bc4cfc765efcaa7e5
  https://github.com/groonga/fluent-plugin-groonga-log/commit/b1491f7bd9167f0bef25583bc4cfc765efcaa7e5

  Merged f546b6e: Merge pull request #6 from kenhys/convert-timestamp-to-string

  Message:
    Set Time#iso8601 instead of Time object into record
    
    Time object should not be member of record. It causes "undefined
    method `to_msgpack`" error because Time object is not defined in
    msgpack format spec.

  Modified files:
    lib/fluent/plugin/parser_groonga_log.rb

  Modified: lib/fluent/plugin/parser_groonga_log.rb (+5 -1)
===================================================================
--- lib/fluent/plugin/parser_groonga_log.rb    2017-09-28 10:11:21 +0900 (2fc1093)
+++ lib/fluent/plugin/parser_groonga_log.rb    2017-10-16 16:46:10 +0900 (1abdab5)
@@ -36,7 +36,11 @@ module Fluent
           event_time = Fluent::EventTime.from_time(statistic.timestamp)
           record = {}
           statistic.each_pair do |member, value|
-            record[member.to_s] = value
+            if value.kind_of?(Time)
+              record[member.to_s] = value.iso8601
+            else
+              record[member.to_s] = value
+            end
           end
           yield event_time, record
         end
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171016/975afa85/attachment-0001.htm 



More information about the Groonga-commit mailing list
Back to archive index