fluent-plugin-s3 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d2e2bf9bcf8921a06dac049e573cff83e1b424b
4
- data.tar.gz: 4c67b88fd89f1aad339efff5bc07f341b9e02780
3
+ metadata.gz: 7338db1eaf442db639f0e6fbfb1756b048c943bf
4
+ data.tar.gz: 2b335117637daa95f7428b2d48984e7ca54874a8
5
5
  SHA512:
6
- metadata.gz: '0182ff57df3b6548dd59e4d3a01db05b4e89fc2d2799a8ceaa8870a2ff985cc12cec429de8d164eb00a7d23d45eb9ad5824c29b77c069fd054a49b9d0dc78bf7'
7
- data.tar.gz: 05f7a10944f6e20a0b395cf25a56010a82e33042f3dd723fcce0229a3bb0df59e3a6350b71c07927a17f364ee87ba277eaf03928695cd887248a1e9cec431b50
6
+ metadata.gz: e35a7293b090d1e2559f246b1782c953f332e63e6bcb1bd3fcf47e563cc80f29f6db280234f909b728e961126d8877e8b6f33dc2178361dc42641013c0799cb3
7
+ data.tar.gz: 7b3f913815dc931d4bf1f09e536e42b3038080c2974396abc973c00bdf70a0845910e6da166f556731668ef5ca83915a36f9bc4504634486f00196bda3904072
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Release 1.1.1 - 2018/01/10
2
+
3
+ * out_s3: Add index_format parameter
4
+
1
5
  Release 1.1.0 - 2017/11/29
2
6
 
3
7
  * Use aws-sdk-s3 / aws-sdk-sqs gems instead of aws-sdk gem
data/README.md CHANGED
@@ -406,6 +406,10 @@ The length of `%{hex_random}` placeholder. Default is 4 as written in
406
406
  Service](https://docs.aws.amazon.com/AmazonS3/latest/dev/request-rate-perf-considerations.html).
407
407
  The maximum length is 16.
408
408
 
409
+ **index_format**
410
+
411
+ `%{index}` is formatted by [sprintf](http://ruby-doc.org/core-2.2.0/Kernel.html#method-i-sprintf) using this format_string. Default is '%d'. Zero padding is supported e.g. `%04d` to ensure minimum length four digits. `%{index}` can be in lowercase or uppercase hex using '%x' or '%X'
412
+
409
413
  **overwrite**
410
414
 
411
415
  Overwrite already existing path. Default is false, which raises an error
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
@@ -98,6 +98,8 @@ module Fluent::Plugin
98
98
  config_param :grant_write_acp, :string, default: nil
99
99
  desc "The length of `%{hex_random}` placeholder(4-16)"
100
100
  config_param :hex_random_length, :integer, default: 4
101
+ desc "`sprintf` format for `%{index}`"
102
+ config_param :index_format, :string, default: "%d"
101
103
  desc "Overwrite already existing path"
102
104
  config_param :overwrite, :bool, default: false
103
105
  desc "Check bucket if exists or not"
@@ -162,6 +164,10 @@ module Fluent::Plugin
162
164
  raise Fluent::ConfigError, "hex_random_length parameter must be less than or equal to #{MAX_HEX_RANDOM_LENGTH}"
163
165
  end
164
166
 
167
+ unless @index_format =~ /^%(0\d*)?[dxX]$/
168
+ raise Fluent::ConfigError, "index_format parameter should follow `%[flags][width]type`. `0` is the only supported flag, and is mandatory if width is specified. `d`, `x` and `X` are supported types"
169
+ end
170
+
165
171
  if @reduced_redundancy
166
172
  log.warn "reduced_redundancy parameter is deprecated. Use storage_class parameter instead"
167
173
  @storage_class = "REDUCED_REDUNDANCY"
@@ -236,7 +242,7 @@ module Fluent::Plugin
236
242
  "%{path}" => @path,
237
243
  "%{time_slice}" => time_slice,
238
244
  "%{file_extension}" => @compressor.ext,
239
- "%{index}" => i,
245
+ "%{index}" => sprintf(@index_format,i),
240
246
  }.merge!(@values_for_s3_object_chunk[chunk.unique_id])
241
247
  values_for_s3_object_key["%{uuid_flush}".freeze] = uuid_random if @uuid_flush_enabled
242
248
 
@@ -302,7 +308,7 @@ module Fluent::Plugin
302
308
  if @s3_metadata
303
309
  put_options[:metadata] = {}
304
310
  @s3_metadata.each do |k, v|
305
- put_options[:metadata][k] = extract_placeholders(v, metadata).gsub(%r(%{[^}]+}), {"%{index}" => i - 1})
311
+ put_options[:metadata][k] = extract_placeholders(v, metadata).gsub(%r(%{[^}]+}), {"%{index}" => sprintf(@index_format, i - 1)})
306
312
  end
307
313
  end
308
314
  @bucket.object(s3path).put(put_options)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-11-30 00:00:00.000000000 Z
12
+ date: 2018-01-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd