lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-0.2.1 vs lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-0.2.2

- old
+ new

@@ -16,21 +16,25 @@ config_param :time_format, :string, :default => nil config_param :aws_key_id, :string config_param :aws_sec_key, :string config_param :s3_bucket, :string + config_param :s3_endpoint, :string, :default => nil def configure(conf) super @timef = TimeFormatter.new(@time_format, @localtime) end def start super - @s3 = AWS::S3.new( - :access_key_id=>@aws_key_id, - :secret_access_key=>@aws_sec_key) + options = { + :access_key_id => @aws_key_id, + :secret_access_key => @aws_sec_key + } + options[:s3_endpoint] = @s3_endpoint if @s3_endpoint + @s3 = AWS::S3.new(options) @bucket = @s3.buckets[@s3_bucket] end def format(tag, time, record) time_str = @timef.format(time)