lib/fluent/plugin/out_grassland.rb in fluent-plugin-grassland-0.0.5 vs lib/fluent/plugin/out_grassland.rb in fluent-plugin-grassland-0.0.6

- old
+ new

@@ -57,11 +57,11 @@ def resetAwsCredential() begin setCredential configure_aws - AWS.kinesis.client.put_record({ + @kinesis.client.put_record({ :stream_name => @stream_name, :data => "test", :partition_key => "#{random.rand(999)}" }) puts "fluentd: reset credential" @@ -142,22 +142,22 @@ bufList[":#{data['pk']}"] = "#{data.to_json}," else bufList[":#{data['pk']}"] += "#{data.to_json}," end if bufList[":#{data['pk']}"].bytesize >= 30720 then - AWS.kinesis.client.put_record({ + @kinesis.client.put_record({ :stream_name => @stream_name, :data => "["+bufList[":#{data['pk']}"].chop+"]", :partition_key => partitionKeys[random.rand(partitionKeys.length)] # :partition_key => data['pk'] }) bufList.delete(":#{data['pk']}") end end dataList.each do |data| if bufList[":#{data['pk']}"] != nil then - AWS.kinesis.client.put_record({ + @kinesis.client.put_record({ :stream_name => @stream_name, :data => "["+bufList[":#{data['pk']}"].chop+"]", :partition_key => partitionKeys[random.rand(partitionKeys.length)] # :partition_key => data['pk'] }) @@ -185,9 +185,10 @@ :log_level => :debug, #http_wire_trace => true ) end - AWS.config(options) + @kinesis = AWS::Kinesis.new(options) + # AWS.config(options) end end end