Hiroshi Hatake
null+****@clear*****
Wed Sep 27 19:02:20 JST 2017
Hiroshi Hatake 2017-09-27 19:02:20 +0900 (Wed, 27 Sep 2017) New Revision: 50b98261150bbe8ca6bce96d920c1483561f95a7 https://github.com/groonga/fluent-plugin-groonga-log/commit/50b98261150bbe8ca6bce96d920c1483561f95a7 Merged bc0122c: Merge pull request #5 from cosmo0920/stringify-keys Message: Stringify keys Modified files: lib/fluent/plugin/parser_groonga_log.rb test/plugin/test_parser_groonga_log.rb Modified: lib/fluent/plugin/parser_groonga_log.rb (+1 -1) =================================================================== --- lib/fluent/plugin/parser_groonga_log.rb 2017-09-27 16:54:22 +0900 (da2f4ad) +++ lib/fluent/plugin/parser_groonga_log.rb 2017-09-27 19:02:20 +0900 (d3182c1) @@ -36,7 +36,7 @@ module Fluent record = statistic.to_h timestamp = record.delete(:timestamp) event_time = Fluent::EventTime.from_time(timestamp) - yield event_time, record + yield event_time, Hash[record.collect{|k,v| [k.to_s, v]}] end end end Modified: test/plugin/test_parser_groonga_log.rb (+10 -10) =================================================================== --- test/plugin/test_parser_groonga_log.rb 2017-09-27 16:54:22 +0900 (7c27609) +++ test/plugin/test_parser_groonga_log.rb 2017-09-27 19:02:20 +0900 (395795c) @@ -13,16 +13,16 @@ class GroongaLogParserTest < Test::Unit::TestCase @parser.instance.parse(log) do |time, record| timestamp = Time.local(2017, 7, 19, 14, 41, 5, 663978) expected = { - :year => 2017, - :month => 7, - :day => 19, - :hour => 14, - :minute => 41, - :second => 5, - :micro_second => 663978, - :log_level => :notice, - :context_id => "18c61700", - :message => "spec:2:update:Object:32(type):8", + "year" => 2017, + "month" => 7, + "day" => 19, + "hour" => 14, + "minute" => 41, + "second" => 5, + "micro_second" => 663978, + "log_level" => :notice, + "context_id" => "18c61700", + "message" => "spec:2:update:Object:32(type):8", } assert_equal([ Fluent::EventTime.from_time(timestamp), -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20170927/39f972d7/attachment-0001.htm