lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-1.0.0.rc7 vs lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-1.0.0.rc8
- old
+ new
@@ -271,11 +271,11 @@
tmp = Tempfile.new("s3-")
tmp.binmode
begin
@compressor.compress(chunk, tmp)
tmp.rewind
- log.debug "out_s3: write chunk with metadata #{chunk.metadata} to s3://#{@s3_bucket}/#{s3path}"
+ log.debug "out_s3: write chunk #{dump_unique_id_hex(chunk.unique_id)} with metadata #{chunk.metadata} to s3://#{@s3_bucket}/#{s3path}"
put_options = {
body: tmp,
content_type: @compressor.content_type,
storage_class: @storage_class,
@@ -288,10 +288,10 @@
put_options[:acl] = @acl if @acl
if @s3_metadata
put_options[:metadata] = {}
@s3_metadata.each do |k, v|
- put_options[:metadata][k] = extract_placeholders(v, metadata)
+ put_options[:metadata][k] = extract_placeholders(v, metadata).gsub(%r(%{[^}]+}), {"%{index}" => i - 1})
end
end
@bucket.object(s3path).put(put_options)
@values_for_s3_object_chunk.delete(chunk.unique_id)