lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-1.0.0.rc5 vs lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-1.0.0.rc6
- old
+ new
@@ -108,10 +108,12 @@
config_param :compute_checksums, :bool, default: nil # use nil to follow SDK default configuration
desc "Signature version for API Request (s3,v4)"
config_param :signature_version, :string, default: nil # use nil to follow SDK default configuration
desc "Given a threshold to treat events as delay, output warning logs if delayed events were put into s3"
config_param :warn_for_delay, :time, default: nil
+ desc "Arbitrary S3 metadata headers to set for the object"
+ config_param :s3_metadata, :hash, default: nil
DEFAULT_FORMAT_TYPE = "out_file"
config_section :format do
config_set_default :@type, DEFAULT_FORMAT_TYPE
@@ -277,9 +279,16 @@
put_options[:ssekms_key_id] = @ssekms_key_id if @ssekms_key_id
put_options[:sse_customer_algorithm] = @sse_customer_algorithm if @sse_customer_algorithm
put_options[:sse_customer_key] = @sse_customer_key if @sse_customer_key
put_options[:sse_customer_key_md5] = @sse_customer_key_md5 if @sse_customer_key_md5
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)
+ end
+ end
@bucket.object(s3path).put(put_options)
@values_for_s3_object_chunk.delete(chunk.unique_id)
if @warn_for_delay