fluent-plugin-kinesis 3.1.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 529a0b5277cab5b82c165d2eaa4339c529381a17
4
- data.tar.gz: fcc5161078a9311d511c5ecb95d4d2dfd9f078e4
2
+ SHA256:
3
+ metadata.gz: 98a12a1569d674676d986f802935ca80df435b4cd2acc4dd15d1951c8b020671
4
+ data.tar.gz: 63238ffd8abeb4c038af46eefff7c528277fa2225c8ca9affbe2714f433a6417
5
5
  SHA512:
6
- metadata.gz: 05661c7aa7080a5e693d58f4d16a07bbeb8f426bbddefacc7fcce78dfe411f098f1829ffd9bf0c5e253b79419605a00d49c1baf44248512e9f6190e97e8c4c1f
7
- data.tar.gz: 7c4530a60cc37bbef7ca85559a07b0fee5038be2d84c195fd68900a7dba73485ae5b2d29aec1f0b585185a160f4317dc111a190951899a0451437b5978d96764
6
+ metadata.gz: c49fb3a4a2a6443375c52a7e416686188160e7a8e85d997c4d4105ee18b06c3e9d94bfcd25e42ef971a3128c55575a9296012a6a5343bc3c9d466a5083c8d78c
7
+ data.tar.gz: 6d2d7fd0012cfcb2282aa6982ff6897333155a0f43c19a90eb365b147f42aac7f16b06dd38924a16403494295031103569529f8fe42055547e077ca558581005
data/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  /gemfiles/Gemfile*.lock
5
5
  /_yardoc/
6
6
  /coverage/
7
+ /vendor/
7
8
  /doc/
8
9
  /pkg/
9
10
  /spec/reports/
@@ -11,3 +12,4 @@
11
12
  /.cache/
12
13
  /amazon-kinesis-producer-native-binarie*
13
14
  /.ruby-version
15
+ /fluent-plugin-kinesis-*.gem
@@ -3,23 +3,37 @@ os: linux
3
3
  sudo: false
4
4
 
5
5
  gemfile:
6
- - Gemfile
7
- - gemfiles/Gemfile.td-agent-3.3.0
6
+ - gemfiles/Gemfile.td-agent-3.8.0
7
+ - gemfiles/Gemfile.td-agent-4.0.1
8
8
 
9
9
  # Test with supported td-agent versions
10
- # https://support.treasuredata.com/hc/en-us/articles/360001479187-The-td-agent-ChangeLog
10
+ # https://tddocs.atlassian.net/wiki/spaces/PD/pages/6291635/The+td-agent+ChangeLog
11
+ # https://docs.fluentd.org/quickstart/td-agent-v2-vs-v3-vs-v4
11
12
  matrix:
12
13
  include:
13
- - rvm: 2.4.1
14
- gemfile: gemfiles/Gemfile.fluentd-0.14.10
14
+ - rvm: 2.7.2 # Latest supported Ruby / https://www.ruby-lang.org/en/downloads/
15
+ gemfile: gemfiles/Gemfile.fluentd-1.11.2 # Latest Fluentd / https://www.fluentd.org/download
16
+ - rvm: 2.3.0 # Oldest supported Ruby
17
+ gemfile: gemfiles/Gemfile.fluentd-0.14.22 # Oldest supported Fluentd
15
18
  - rvm: 2.4.2 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.1.1/config/projects/td-agent3.rb#L17
16
19
  gemfile: gemfiles/Gemfile.td-agent-3.1.1
17
- - rvm: 2.4.4 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.2.0/config/projects/td-agent3.rb#L22
18
- gemfile: gemfiles/Gemfile.td-agent-3.2.0
19
20
  - rvm: 2.4.4 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.2.1/config/projects/td-agent3.rb#L22
20
21
  gemfile: gemfiles/Gemfile.td-agent-3.2.1
21
22
  - rvm: 2.4.5 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.3.0/config/projects/td-agent3.rb#L22
22
23
  gemfile: gemfiles/Gemfile.td-agent-3.3.0
24
+ - rvm: 2.4.6 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.1/config/projects/td-agent3.rb#L22
25
+ gemfile: gemfiles/Gemfile.td-agent-3.4.1
26
+ - rvm: 2.4.9 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.1/config/projects/td-agent3.rb#L22
27
+ gemfile: gemfiles/Gemfile.td-agent-3.5.1
28
+ - rvm: 2.4.9 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.6.0/config/projects/td-agent3.rb#L22
29
+ gemfile: gemfiles/Gemfile.td-agent-3.6.0
30
+ - rvm: 2.4.10 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.7.1/config/projects/td-agent3.rb#L22
31
+ gemfile: gemfiles/Gemfile.td-agent-3.7.1
32
+ - rvm: 2.4.10 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.8.0/config/projects/td-agent3.rb#L22
33
+ gemfile: gemfiles/Gemfile.td-agent-3.8.0
34
+ - rvm: 2.7.1 # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/v4.0.1/td-agent/config.rb#L16
35
+ gemfile: gemfiles/Gemfile.td-agent-4.0.1
36
+
23
37
  fast_finish: true
24
38
 
25
39
  script: bundle exec rake test
@@ -1,5 +1,33 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.3.0
4
+
5
+ - Feature - Add web_identity_credentials configuration for IRSA : [#208](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/208) [#209](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/209)
6
+ - Enhancement - Remove strict gem pinning of google-protobuf to support Ruby 2.7 : [#199](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/199) [#206](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/206)
7
+ - Enhancement - Add td-agent v4 (4.0.1) and Fluentd 1.11.2 to test cases
8
+
9
+ ## 3.2.3
10
+
11
+ - Enhancement - Add placeholder support for delivery_stream_name of kinesis_firehose : [#203](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/203) [#204](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/204)
12
+
13
+ ## 3.2.2
14
+
15
+ - Enhancement - Make more strict gem pinning to deal with google-protobuf requiring Ruby 2.5+ : [#199](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/199)
16
+ - Bug - Fix MissingRegionError when http_proxy and endpoint_url are specified : [#197](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/197)
17
+
18
+ ## 3.2.1
19
+
20
+ - Enhancement - Use Fluent::MessagePackFactory class methods instead of Mixin with Fluentd >= v1.8 : [#194](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/194) [#195](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/195)
21
+ - Enhancement - Add td-agent 3.5.1 and Fluentd 1.9.1 to test cases
22
+
23
+ ## 3.2.0
24
+
25
+ - Feature - Add placeholder support for stream names to send records to multiple streams : [#165](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/165) [#174](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/174)
26
+ - Enhancement - Add sts_endpoint_url configuration parameter to support AWS STS regional endpoints : [#186](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/186)
27
+ - Enhancement - Add aws_ses_token configuration parameter to use IAM with MFA and directly provided temporary credentials : [#166](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/166)
28
+ - Dependency - Update gem dependency to Ruby 2.3.0+ and Fluentd 0.14.22+
29
+ - Bug - Fix dependency problem on AWS SDK with td-agent v3.4.1
30
+
3
31
  ## 3.1.0
4
32
 
5
33
  - Feature - Add process_credentials configuration : [#178](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/178)
@@ -4,3 +4,5 @@ to the Fluent Plugin for Amazon Kinesis Streams and Amazon Kinesis Firehose. Giv
4
4
  Genki Sugawara
5
5
  sgwr_dts@yahoo.co.jp
6
6
  https://github.com/winebarrel
7
+ https://github.com/adammw
8
+ https://github.com/cosmo0920
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Fluent plugin for Amazon Kinesis
2
2
 
3
- [![Gitter](https://badges.gitter.im/awslabs/aws-fluent-plugin-kinesis.svg)](https://gitter.im/awslabs/aws-fluent-plugin-kinesis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
4
3
  [![Build Status](https://travis-ci.org/awslabs/aws-fluent-plugin-kinesis.svg?branch=master)](https://travis-ci.org/awslabs/aws-fluent-plugin-kinesis)
5
4
  [![Gem Version](https://badge.fury.io/rb/fluent-plugin-kinesis.svg)](https://rubygems.org/gems/fluent-plugin-kinesis)
5
+ [![Gem Downloads](https://img.shields.io/gem/dt/fluent-plugin-kinesis.svg)](https://rubygems.org/gems/fluent-plugin-kinesis)
6
6
 
7
7
  [Fluentd][fluentd] output plugin
8
- that sends events to [Amazon Kinesis Data Streams][streams] and [Amazon Kinesis Data Firehose][firehose]. Also it supports [KPL Aggregated record format][kpl]. This gem includes three output plugins respectively:
8
+ that sends events to [Amazon Kinesis Data Streams][streams] and [Amazon Kinesis Data Firehose][firehose]. Also it supports [KPL Aggregated Record Format][kpl]. This gem includes three output plugins respectively:
9
9
 
10
10
  - `kinesis_streams`
11
11
  - `kinesis_firehose`
@@ -24,7 +24,7 @@ Or you can install this plugin for [td-agent][td-agent] as:
24
24
 
25
25
  td-agent-gem install fluent-plugin-kinesis
26
26
 
27
- If you would like to build by yourself and install, please see the section below. Your need [bundler][bundler] for this.
27
+ If you would like to build by yourself and install, see the section below. Your need [bundler][bundler] for this.
28
28
 
29
29
  In case of using with Fluentd: Fluentd will be also installed via the process below.
30
30
 
@@ -50,8 +50,8 @@ Or just download specify your Ruby library path. Below is the sample for specify
50
50
  export RUBYLIB=$RUBYLIB:/path/to/aws-fluent-plugin-kinesis/lib
51
51
 
52
52
  ## Dependencies
53
- * Ruby 2.1.0+
54
- * Fluentd 0.14.10+
53
+ * Ruby 2.3.0+
54
+ * Fluentd 0.14.22+ (td-agent v3.1.0+)
55
55
 
56
56
  ## Basic Usage
57
57
  Here are general procedures for using this plugin:
@@ -82,7 +82,7 @@ Assume you use Amazon EC2 instances with Instance profile. If you want to use sp
82
82
  stream_name your_stream
83
83
  partition_key key # Otherwise, use random partition key
84
84
  </match>
85
- For more detail, see [Configuration: kinesis_streams](#configuration-kinesis_streams)
85
+ For more details, see [Configuration: kinesis_streams](#configuration-kinesis_streams).
86
86
 
87
87
  ### kinesis_firehose
88
88
  <match your_tag>
@@ -90,7 +90,7 @@ For more detail, see [Configuration: kinesis_streams](#configuration-kinesis_str
90
90
  region us-east-1
91
91
  delivery_stream_name your_stream
92
92
  </match>
93
- For more detail, see [Configuration: kinesis_firehose](#configuration-kinesis_firehose)
93
+ For more details, see [Configuration: kinesis_firehose](#configuration-kinesis_firehose).
94
94
 
95
95
  ### kinesis_streams_aggregated
96
96
  <match your_tag>
@@ -100,10 +100,10 @@ For more detail, see [Configuration: kinesis_firehose](#configuration-kinesis_fi
100
100
  # Unlike kinesis_streams, there is no way to use dynamic partition key.
101
101
  # fixed_partition_key or random.
102
102
  </match>
103
- For more detail, see [Configuration: kinesis_streams_aggregated](#configuration-kinesis_streams_aggregated)
103
+ For more details, see [Configuration: kinesis_streams_aggregated](#configuration-kinesis_streams_aggregated).
104
104
 
105
105
  ### For better throughput
106
- Add configuration like below:
106
+ Add configurations like below:
107
107
 
108
108
  flush_interval 1
109
109
  chunk_limit_size 1m
@@ -111,12 +111,14 @@ Add configuration like below:
111
111
  flush_thread_burst_interval 0.01
112
112
  flush_thread_count 15
113
113
 
114
+ When you use Fluent v1.0 (td-agent3), write these configurations in buffer section. For more details, see [Config: Buffer Section][fluentd-buffer-section].
115
+
114
116
  Note: Each value should be adjusted to your system by yourself.
115
117
 
116
118
  ## Configuration: Credentials
117
119
  To put records into Amazon Kinesis Data Streams or Firehose, you need to provide AWS security credentials somehow. Without specifying credentials in config file, this plugin automatically fetch credential just following AWS SDK for Ruby does (environment variable, shared profile, and instance profile).
118
120
 
119
- This plugin uses the same configuration in [fluent-plugin-s3][fluent-plugin-s3].
121
+ This plugin uses the same configuration in [fluent-plugin-s3][fluent-plugin-s3], but also supports aws session tokens for temporary credentials.
120
122
 
121
123
  **aws_key_id**
122
124
 
@@ -126,12 +128,16 @@ AWS access key id. This parameter is required when your agent is not running on
126
128
 
127
129
  AWS secret key. This parameter is required when your agent is not running on EC2 instance with an IAM Role.
128
130
 
131
+ **aws_ses_token**
132
+
133
+ AWS session token. This parameter is optional, but can be provided if using MFA or temporary credentials when your agent is not running on EC2 instance with an IAM Role.
134
+
129
135
  **aws_iam_retries**
130
136
 
131
137
  The number of attempts to make (with exponential backoff) when loading instance profile credentials from the EC2 metadata service using an IAM role. Defaults to 5 retries.
132
138
 
133
139
  ### assume_role_credentials
134
- Typically, you use AssumeRole for cross-account access or federation.
140
+ Typically, you can use AssumeRole for cross-account access or federation.
135
141
 
136
142
  <match *>
137
143
  @type kinesis_streams
@@ -145,9 +151,9 @@ Typically, you use AssumeRole for cross-account access or federation.
145
151
  See also:
146
152
 
147
153
  * [Using IAM Roles - AWS Identity and Access
148
- Management](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
149
- * [Aws::STS::Client](http://docs.aws.amazon.com/sdkforruby/api/Aws/STS/Client.html)
150
- * [Aws::AssumeRoleCredentials](http://docs.aws.amazon.com/sdkforruby/api/Aws/AssumeRoleCredentials.html)
154
+ Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
155
+ * [Aws::STS::Client](https://docs.aws.amazon.com/sdkforruby/api/Aws/STS/Client.html)
156
+ * [Aws::AssumeRoleCredentials](https://docs.aws.amazon.com/sdkforruby/api/Aws/AssumeRoleCredentials.html)
151
157
 
152
158
  **role_arn (required)**
153
159
 
@@ -175,6 +181,54 @@ Proxy url for proxying requests to amazon sts service api. This needs to be set
175
181
  It should be added to assume_role_credentials configuration stanza in the next format:
176
182
  sts_http_proxy http://[username:password]@hostname:port
177
183
 
184
+ **sts_endpoint_url**
185
+
186
+ STS API endpoint url. This can be used to override the default global STS API endpoint of sts.amazonaws.com. Using regional endpoints may be preferred to reduce latency, and are required if utilizing a PrivateLink VPC Endpoint for STS API calls.
187
+
188
+
189
+ ### web_identity_credentials
190
+
191
+ Similar to the assume_role_credentials, but for usage in EKS.
192
+
193
+ <match *>
194
+ @type kinesis_streams
195
+
196
+ <web_identity_credentials>
197
+ role_arn ROLE_ARN
198
+ role_session_name ROLE_SESSION_NAME
199
+ web_identity_token_file AWS_WEB_IDENTITY_TOKEN_FILE
200
+ </web_identity_credentials>
201
+ </match>
202
+
203
+ See also:
204
+
205
+ * [Using IAM Roles - AWS Identity and Access Management](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
206
+ * [IAM Roles For Service Accounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html)
207
+ * [Aws::STS::Client](http://docs.aws.amazon.com/sdkforruby/api/Aws/STS/Client.html)
208
+ * [Aws::AssumeRoleWebIdentityCredentials](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/AssumeRoleWebIdentityCredentials.html)
209
+
210
+ **role_arn (required)**
211
+
212
+ The Amazon Resource Name (ARN) of the role to assume.
213
+
214
+ **role_session_name (required)**
215
+
216
+ An identifier for the assumed role session.
217
+
218
+ **web_identity_token_file (required)**
219
+
220
+ The absolute path to the file on disk containing the OIDC token
221
+
222
+ **policy**
223
+
224
+ An IAM policy in JSON format.
225
+
226
+ **duration_seconds**
227
+
228
+ The duration, in seconds, of the role session. The value can range from
229
+ 900 seconds (15 minutes) to 43200 seconds (12 hours). By default, the value
230
+ is set to 3600 seconds (1 hour).
231
+
178
232
  ### instance_profile_credentials
179
233
 
180
234
  Retrieve temporary security credentials via HTTP request. This is useful on EC2 instance.
@@ -190,11 +244,11 @@ Retrieve temporary security credentials via HTTP request. This is useful on EC2
190
244
 
191
245
  See also:
192
246
 
193
- * [Aws::InstanceProfileCredentials](http://docs.aws.amazon.com/sdkforruby/api/Aws/InstanceProfileCredentials.html)
247
+ * [Aws::InstanceProfileCredentials](https://docs.aws.amazon.com/sdkforruby/api/Aws/InstanceProfileCredentials.html)
194
248
  * [Temporary Security Credentials - AWS Identity and Access
195
- Management](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)
249
+ Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)
196
250
  * [Instance Metadata and User Data - Amazon Elastic Compute
197
- Cloud](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
251
+ Cloud](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
198
252
 
199
253
  **retries**
200
254
 
@@ -231,7 +285,7 @@ This loads AWS access credentials from local ini file. This is useful for local
231
285
 
232
286
  See also:
233
287
 
234
- * [Aws::SharedCredentials](http://docs.aws.amazon.com/sdkforruby/api/Aws/SharedCredentials.html)
288
+ * [Aws::SharedCredentials](https://docs.aws.amazon.com/sdkforruby/api/Aws/SharedCredentials.html)
235
289
 
236
290
  **path**
237
291
 
@@ -265,7 +319,7 @@ Command to be executed as an external process.
265
319
  ## Configuration: Format
266
320
 
267
321
  ### format (section)
268
- This plugin use `Fluent::TextFormatter` to serialize record to string. For more detail, see [formatter.rb]. By default, it uses `json` formatter same as specific like below:
322
+ This plugin uses `Fluent::TextFormatter` to serialize record to string. See [formatter.rb] for more details. By default, it uses `json` formatter same as specific like below:
269
323
 
270
324
  <match *>
271
325
  @type kinesis_streams
@@ -275,10 +329,12 @@ This plugin use `Fluent::TextFormatter` to serialize record to string. For more
275
329
  </format>
276
330
  </match>
277
331
 
332
+ For other configurations of `json` formatter, see [json formatter plugin][fluentd-formatter-json].
333
+
278
334
  ### inject (section)
279
- This plugin use `Fluent::TimeFormatter` and other injection configurations. For more detail, see [inject.rb]. This section only works with Fluentd v0.14.
335
+ This plugin uses `Fluent::TimeFormatter` and other injection configurations. See [inject.rb] for more details.
280
336
 
281
- For example, the config below will add `time` field whose value is eventtime with nanosecond and `tag` field whose value is its tag. (Mostly same as `include_time key true` and `include_tag_key true`)
337
+ For example, the config below will add `time` field whose value is event time with nanosecond and `tag` field whose value is its tag.
282
338
 
283
339
  <match *>
284
340
  @type kinesis_streams
@@ -293,16 +349,6 @@ By default, `time_type string` and `time_format %Y-%m-%dT%H:%M:%S.%N%z` are alre
293
349
 
294
350
  Also, there are some format related options below:
295
351
 
296
- ### include_time_key
297
- **Notice** With Fluentd v0.14, you should use inject section.
298
-
299
- Defalut `false`. If you want to include `time` field in your record, set `true`.
300
-
301
- ### include_tag_key
302
- **Notice** With Fluentd v0.14, you should use inject section.
303
-
304
- Defalut `false`. If you want to include `tag` field in your record, set `true`.
305
-
306
352
  ### data_key
307
353
  If your record contains a field whose string should be sent to Amazon Kinesis directly (without formatter), use this parameter to specify the field. In that case, other fields than **data_key** are thrown away and never sent to Amazon Kinesis. Default `nil`, which means whole record will be formatted and sent.
308
354
 
@@ -368,6 +414,30 @@ Here are `kinesis_streams` specific configurations.
368
414
  ### stream_name
369
415
  Name of the stream to put data.
370
416
 
417
+ As of Fluentd v1, built-in placeholders are supported. Now, you can also use built-in placeholders for this parameter.
418
+
419
+ **NOTE:**
420
+ Built-in placeholders require target key information in your buffer section attributes.
421
+
422
+ e.g.)
423
+
424
+ When you specify the following `stream_name` configuration with built-in placeholder:
425
+
426
+ ```aconf
427
+ stream_name "${$.kubernetes.annotations.kinesis_streams}"
428
+ ```
429
+
430
+ you ought to specify the corresponding attributes in buffer section:
431
+
432
+ ```aconf
433
+ # $.kubernetes.annotations.kinesis_streams needs to be set in buffer attributes
434
+ <buffer $.kubernetes.annotations.kinesis_streams>
435
+ # ...
436
+ </buffer>
437
+ ```
438
+
439
+ For more details, refer [Placeholders section in the official Fluentd document](https://docs.fluentd.org/configuration/buffer-section#placeholders).
440
+
371
441
  ### partition_key
372
442
  A key to extract partition key from JSON object. Default `nil`, which means partition key will be generated randomly.
373
443
 
@@ -377,6 +447,30 @@ Here are `kinesis_firehose` specific configurations.
377
447
  ### delivery_stream_name
378
448
  Name of the delivery stream to put data.
379
449
 
450
+ As of Fluentd v1, built-in placeholders are supported. Now, you can also use built-in placeholders for this parameter.
451
+
452
+ **NOTE:**
453
+ Built-in placeholders require target key information in your buffer section attributes.
454
+
455
+ e.g.)
456
+
457
+ When you specify the following `delivery_stream_name` configuration with built-in placeholder:
458
+
459
+ ```aconf
460
+ delivery_stream_name "${$.kubernetes.annotations.kinesis_firehose_streams}"
461
+ ```
462
+
463
+ you ought to specify the corresponding attributes in buffer section:
464
+
465
+ ```aconf
466
+ # $.kubernetes.annotations.kinesis_firehose_streams needs to be set in buffer attributes
467
+ <buffer $.kubernetes.annotations.kinesis_firehose_streams>
468
+ # ...
469
+ </buffer>
470
+ ```
471
+
472
+ For more details, refer [Placeholders section in the official Fluentd document](https://docs.fluentd.org/configuration/buffer-section#placeholders).
473
+
380
474
  ### append_new_line
381
475
  Boolean. Default `true`. If it is enabled, the plugin adds new line character (`\n`) to each serialized record.
382
476
  Before appending `\n`, plugin calls chomp and removes separator from the end of each record as [chomp_record](#chomp_record) is `true`. Therefore, you don't need to enable [chomp_record](#chomp_record) option when you use [kinesis_firehose](#kinesis_firehose) output with default configuration ([append_new_line](#append_new_line) is `true`). If you want to set [append_new_line](#append_new_line) `false`, you can choose [chomp_record](#chomp_record) `false` (default) or `true` (compatible format with plugin v2).
@@ -387,6 +481,30 @@ Here are `kinesis_streams_aggregated` specific configurations.
387
481
  ### stream_name
388
482
  Name of the stream to put data.
389
483
 
484
+ As of Fluentd v1, built-in placeholders are supported. Now, you can also use built-in placeholders for this parameter.
485
+
486
+ **NOTE:**
487
+ Built-in placeholders require target key information in your buffer section attributes.
488
+
489
+ e.g.)
490
+
491
+ When you specify the following `stream_name` configuration with built-in placeholder:
492
+
493
+ ```aconf
494
+ stream_name "${$.kubernetes.annotations.kinesis_streams_aggregated}"
495
+ ```
496
+
497
+ you ought to specify the corresponding attributes in buffer section:
498
+
499
+ ```aconf
500
+ # $.kubernetes.annotations.kinesis_streams_aggregated needs to be set in buffer attributes
501
+ <buffer $.kubernetes.annotations.kinesis_streams_aggregated>
502
+ # ...
503
+ </buffer>
504
+ ```
505
+
506
+ For more details, refer [Placeholders section in the official Fluentd document](https://docs.fluentd.org/configuration/buffer-section#placeholders).
507
+
390
508
  ### fixed_partition_key
391
509
  A value of fixed partition key. Default `nil`, which means partition key will be generated randomly.
392
510
 
@@ -414,17 +532,18 @@ Bug reports and pull requests are welcome on [GitHub][github].
414
532
  * [Amazon Kinesis Data Streams Developer Guide](http://docs.aws.amazon.com/kinesis/latest/dev/introduction.html)
415
533
  * [Amazon Kinesis Data Firehose Developer Guide](http://docs.aws.amazon.com/firehose/latest/dev/what-is-this-service.html)
416
534
 
417
- [fluentd]: http://fluentd.org/
535
+ [fluentd]: https://www.fluentd.org/
418
536
  [streams]: https://aws.amazon.com/kinesis/streams/
419
537
  [firehose]: https://aws.amazon.com/kinesis/firehose/
420
538
  [kpl]: https://github.com/awslabs/amazon-kinesis-producer/blob/master/aggregation-format.md
421
- [td-agent]: https://github.com/treasure-data/td-agent
422
- [bundler]: http://bundler.io/
423
- [region]: http://docs.aws.amazon.com/general/latest/gr/rande.html#ak_region
424
- [fluentd_buffer]: http://docs.fluentd.org/articles/buffer-plugin-overview
539
+ [td-agent]: https://github.com/treasure-data/omnibus-td-agent
540
+ [bundler]: https://bundler.io/
541
+ [region]: https://docs.aws.amazon.com/general/latest/gr/rande.html#ak_region
542
+ [fluentd-buffer-section]: https://docs.fluentd.org/configuration/buffer-section
543
+ [fluentd-formatter-json]: https://docs.fluentd.org/formatter/json
425
544
  [github]: https://github.com/awslabs/aws-fluent-plugin-kinesis
426
545
  [formatter.rb]: https://github.com/fluent/fluentd/blob/master/lib/fluent/formatter.rb
427
546
  [inject.rb]: https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin_helper/inject.rb
428
- [fluentd-doc-kinesis]: http://docs.fluentd.org/articles/kinesis-stream
547
+ [fluentd-doc-kinesis]: https://docs.fluentd.org/how-to-guides/kinesis-stream
429
548
  [fluent-plugin-s3]: https://github.com/fluent/fluent-plugin-s3
430
549
  [v1-readme]: https://github.com/awslabs/aws-fluent-plugin-kinesis/blob/v1/README.md
@@ -28,9 +28,9 @@ Gem::Specification.new do |spec|
28
28
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
29
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ["lib"]
31
- spec.required_ruby_version = '>= 2.1'
31
+ spec.required_ruby_version = '>= 2.3'
32
32
 
33
- spec.add_dependency "fluentd", ">= 0.14.10", "< 2"
33
+ spec.add_dependency "fluentd", ">= 0.14.22", "< 2"
34
34
 
35
35
  # This plugin is sometimes used with s3 plugin, so watch out for conflicts
36
36
  # https://rubygems.org/gems/fluent-plugin-s3
@@ -40,12 +40,20 @@ Gem::Specification.new do |spec|
40
40
  # NoMethodError: undefined method `event=' for #<Seahorse::Model::Shapes::ShapeRef:*>
41
41
  # https://github.com/aws/aws-sdk-ruby/commit/03d60f9d3d821e645bd2a3efca066f37350ef906#diff-c69f15af8ea3eb9ab152659476e04608R401
42
42
  # https://github.com/aws/aws-sdk-ruby/commit/571c2d0e5ff9c24ff72893a08a74790db591fb57#diff-a55155f04aa6559460a0814e264eb0cdR43
43
- spec.add_dependency "aws-sdk-kinesis", "~> 1", "!= 1.4", "!= 1.5"
43
+ # Exclude aws-sdk-kinesis v1.14 to avoid aws-sdk-core dependency problem with td-agent v3.4.1
44
+ # LoadError: cannot load such file -- aws-sdk-core/plugins/transfer_encoding.rb
45
+ # https://github.com/aws/aws-sdk-ruby/commit/bb61ed0a2fabc6b1f90b757f13f37d5aeae48d8a#diff-b493e941d32289cd2df7eebc3fc5be2cR26
46
+ # https://github.com/aws/aws-sdk-ruby/commit/e26577d2a426a4be79cd2d9edc1a4a4176e388ba#diff-10f50e27b30c3dc522b3c25db5782e2e
47
+ spec.add_dependency "aws-sdk-kinesis", "~> 1", "!= 1.4", "!= 1.5", "!= 1.14"
44
48
  # Exclude aws-sdk-firehose v1.9 to avoid aws-sdk-core dependency problem with td-agent v3.2.1
45
49
  # LoadError: cannot load such file -- aws-sdk-core/plugins/endpoint_discovery.rb
46
50
  # https://github.com/aws/aws-sdk-ruby/commit/85d8538a62255e58d9e176ee524a9f94354b51a0#diff-d51486091a10ada65b308b7f45966af1R18
47
51
  # https://github.com/aws/aws-sdk-ruby/commit/7c9584bc6473100df9aec9333ab491ad4faeeca8#diff-be94f87e58e00329a6c0e03e43d5c292
48
- spec.add_dependency "aws-sdk-firehose", "~> 1", "!= 1.5", "!= 1.9"
52
+ # Exclude aws-sdk-firehose v1.15 to avoid aws-sdk-core dependency problem with td-agent v3.4.1
53
+ # LoadError: cannot load such file -- aws-sdk-core/plugins/transfer_encoding.rb
54
+ # https://github.com/aws/aws-sdk-ruby/commit/bb61ed0a2fabc6b1f90b757f13f37d5aeae48d8a#diff-d51486091a10ada65b308b7f45966af1R26
55
+ # https://github.com/aws/aws-sdk-ruby/commit/e26577d2a426a4be79cd2d9edc1a4a4176e388ba#diff-10f50e27b30c3dc522b3c25db5782e2e
56
+ spec.add_dependency "aws-sdk-firehose", "~> 1", "!= 1.5", "!= 1.9", "!= 1.15"
49
57
 
50
58
  spec.add_dependency "google-protobuf", "~> 3"
51
59
 
@@ -17,4 +17,4 @@ source 'https://rubygems.org'
17
17
  # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
18
  gemspec path: ".."
19
19
 
20
- gem "fluentd", "0.14.10"
20
+ gem "fluentd", "0.14.22"
@@ -0,0 +1,20 @@
1
+ #
2
+ # Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ gem "fluentd", "1.11.2"
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.1.0
21
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.1.0/config/projects/td-agent3.rb#L25
22
+ gem "fluentd", "0.14.25"
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.1.0/plugin_gems.rb#L16-L23
24
+ gem "jmespath", "1.3.1"
25
+ gem "aws-partitions", "1.42.0"
26
+ gem "aws-sigv4", "1.0.2"
27
+ gem "aws-sdk-core", "3.11.0"
28
+ gem "aws-sdk-kms", "1.3.0"
29
+ gem "aws-sdk-sqs", "1.3.0"
30
+ gem "aws-sdk-s3", "1.8.0"
31
+ gem "fluent-plugin-s3", "1.1.0"
@@ -0,0 +1,34 @@
1
+ #
2
+ # Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.4.1
21
+ # td-agent v3.4.0 has the same dependencies
22
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.1/config/projects/td-agent3.rb#L27
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.0/config/projects/td-agent3.rb#L27
24
+ gem "fluentd", "1.4.2"
25
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.1/plugin_gems.rb#L16-L23
26
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.0/plugin_gems.rb#L16-L23
27
+ gem "jmespath", "1.4.0"
28
+ gem "aws-partitions", "1.149.0"
29
+ gem "aws-sigv4", "1.1.0"
30
+ gem "aws-sdk-core", "3.48.3"
31
+ gem "aws-sdk-kms", "1.16.0"
32
+ gem "aws-sdk-sqs", "1.13.0"
33
+ gem "aws-sdk-s3", "1.36.0"
34
+ gem "fluent-plugin-s3", "1.1.9"
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.5.0
21
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.0/config/projects/td-agent3.rb#L27
22
+ gem "fluentd", "1.7.0"
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.0/plugin_gems.rb#L16-L23
24
+ gem "jmespath", "1.4.0"
25
+ gem "aws-partitions", "1.195.0"
26
+ gem "aws-sigv4", "1.1.0"
27
+ gem "aws-sdk-core", "3.61.2"
28
+ gem "aws-sdk-kms", "1.24.0"
29
+ gem "aws-sdk-sqs", "1.20.0"
30
+ gem "aws-sdk-s3", "1.46.0"
31
+ gem "fluent-plugin-s3", "1.1.11"
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.5.1
21
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.1/config/projects/td-agent3.rb#L27
22
+ gem "fluentd", "1.7.4"
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.1/plugin_gems.rb#L16-L23
24
+ gem "jmespath", "1.4.0"
25
+ gem "aws-partitions", "1.230.0"
26
+ gem "aws-sigv4", "1.1.0"
27
+ gem "aws-sdk-core", "3.72.0"
28
+ gem "aws-sdk-kms", "1.25.0"
29
+ gem "aws-sdk-sqs", "1.23.0"
30
+ gem "aws-sdk-s3", "1.52.0"
31
+ gem "fluent-plugin-s3", "1.2.0"
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.6.0
21
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.6.0/config/projects/td-agent3.rb#L27
22
+ gem "fluentd", "1.9.2"
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.6.0/plugin_gems.rb#L16-L23
24
+ gem "jmespath", "1.4.0"
25
+ gem "aws-partitions", "1.273.0"
26
+ gem "aws-sigv4", "1.1.0"
27
+ gem "aws-sdk-core", "3.90.0"
28
+ gem "aws-sdk-kms", "1.29.0"
29
+ gem "aws-sdk-sqs", "1.23.1"
30
+ gem "aws-sdk-s3", "1.60.2"
31
+ gem "fluent-plugin-s3", "1.3.0"
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.7.1
21
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.7.1/config/projects/td-agent3.rb#L27
22
+ gem "fluentd", "1.10.2"
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.7.1/plugin_gems.rb#L16-L23
24
+ gem "jmespath", "1.4.0"
25
+ gem "aws-partitions", "1.297.0"
26
+ gem "aws-sigv4", "1.1.1"
27
+ gem "aws-sdk-core", "3.94.0"
28
+ gem "aws-sdk-kms", "1.30.0"
29
+ gem "aws-sdk-sqs", "1.24.0"
30
+ gem "aws-sdk-s3", "1.63.0"
31
+ gem "fluent-plugin-s3", "1.3.1"
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v3.8.0
21
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.8.0/config/projects/td-agent3.rb#L27
22
+ gem "fluentd", "1.11.1"
23
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.8.0/plugin_gems.rb#L16-L23
24
+ gem "jmespath", "1.4.0"
25
+ gem "aws-partitions", "1.332.0"
26
+ gem "aws-sigv4", "1.2.0"
27
+ gem "aws-sdk-core", "3.100.0"
28
+ gem "aws-sdk-kms", "1.34.1"
29
+ gem "aws-sdk-sqs", "1.28.0"
30
+ gem "aws-sdk-s3", "1.69.1"
31
+ gem "fluent-plugin-s3", "1.3.2"
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
5
+ # may not use this file except in compliance with the License. A copy of
6
+ # the License is located at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is
11
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
+ # ANY KIND, either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
15
+ source 'https://rubygems.org'
16
+
17
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
+ gemspec path: ".."
19
+
20
+ # Specify related gems for td-agent v4.0.1
21
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/v4.0.1/td-agent/config.rb#L4
22
+ gem "fluentd", "1.11.1"
23
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/v4.0.1/gemfiles/linux/Gemfile#L35-L42
24
+ gem "jmespath", "1.4.0"
25
+ gem "aws-partitions", "1.352.0"
26
+ gem "aws-sdk-core", "3.104.3"
27
+ gem "aws-sdk-kms", "1.36.0"
28
+ gem "aws-sdk-sqs", "1.30.0"
29
+ gem "aws-sigv4", "1.2.1"
30
+ gem "aws-sdk-s3", "1.75.0"
31
+ gem "fluent-plugin-s3", "1.4.0"
@@ -12,6 +12,8 @@
12
12
  # ANY KIND, either express or implied. See the License for the specific
13
13
  # language governing permissions and limitations under the License.
14
14
 
15
+ require 'fluent/version'
16
+ require 'fluent/msgpack_factory'
15
17
  require 'fluent/plugin/output'
16
18
  require 'fluent/plugin/kinesis_helper/client'
17
19
  require 'fluent/plugin/kinesis_helper/api'
@@ -20,7 +22,6 @@ require 'zlib'
20
22
  module Fluent
21
23
  module Plugin
22
24
  class KinesisOutput < Fluent::Plugin::Output
23
- include Fluent::MessagePackFactory::Mixin
24
25
  include KinesisHelper::Client
25
26
  include KinesisHelper::API
26
27
 
@@ -83,6 +84,10 @@ module Fluent
83
84
  true
84
85
  end
85
86
 
87
+ def formatted_to_msgpack_binary?
88
+ true
89
+ end
90
+
86
91
  private
87
92
 
88
93
  def data_formatter_create(conf)
@@ -133,15 +138,21 @@ module Fluent
133
138
  ''
134
139
  end
135
140
 
141
+ if Gem::Version.new(Fluent::VERSION) >= Gem::Version.new('1.8.0')
142
+ def msgpack_unpacker(*args)
143
+ Fluent::MessagePackFactory.msgpack_unpacker(*args)
144
+ end
145
+ else
146
+ include Fluent::MessagePackFactory::Mixin
147
+ end
148
+
136
149
  def write_records_batch(chunk, &block)
137
150
  unique_id = chunk.dump_unique_id_hex(chunk.unique_id)
138
- chunk.open do |io|
139
- records = msgpack_unpacker(io).to_enum
140
- split_to_batches(records) do |batch, size|
141
- log.debug(sprintf "Write chunk %s / %3d records / %4d KB", unique_id, batch.size, size/1024)
142
- batch_request_with_retry(batch, &block)
143
- log.debug("Finish writing chunk")
144
- end
151
+ records = chunk.to_enum(:msgpack_each)
152
+ split_to_batches(records) do |batch, size|
153
+ log.debug(sprintf "Write chunk %s / %3d records / %4d KB", unique_id, batch.size, size/1024)
154
+ batch_request_with_retry(batch, &block)
155
+ log.debug("Finish writing chunk")
145
156
  end
146
157
  end
147
158
 
@@ -21,14 +21,15 @@ module Fluent
21
21
  module Client
22
22
  module ClientParams
23
23
  include Fluent::Configurable
24
- config_param :region, :string, default: nil
24
+ config_param :region, :string, default: nil
25
25
 
26
26
  config_param :http_proxy, :string, default: nil, secret: true
27
27
  config_param :endpoint, :string, default: nil
28
28
  config_param :ssl_verify_peer, :bool, default: true
29
29
 
30
- config_param :aws_key_id, :string, default: nil, secret: true
31
- config_param :aws_sec_key, :string, default: nil, secret: true
30
+ config_param :aws_key_id, :string, default: nil, secret: true
31
+ config_param :aws_sec_key, :string, default: nil, secret: true
32
+ config_param :aws_ses_token, :string, default: nil, secret: true
32
33
  config_section :assume_role_credentials, multi: false do
33
34
  desc "The Amazon Resource Name (ARN) of the role to assume"
34
35
  config_param :role_arn, :string, secret: true
@@ -42,6 +43,22 @@ module Fluent
42
43
  config_param :external_id, :string, default: nil, secret: true
43
44
  desc "A http proxy url for requests to aws sts service"
44
45
  config_param :sts_http_proxy, :string, default: nil, secret: true
46
+ desc "A URL for a regional STS API endpoint, the default is global"
47
+ config_param :sts_endpoint_url, :string, default: nil
48
+ end
49
+ # Refer to the following link for additional parameters that could be added:
50
+ # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/STS/Client.html#assume_role_with_web_identity-instance_method
51
+ config_section :web_identity_credentials, multi: false do
52
+ desc "The Amazon Resource Name (ARN) of the role to assume"
53
+ config_param :role_arn, :string
54
+ desc "An identifier for the assumed role session"
55
+ config_param :role_session_name, :string
56
+ desc "The absolute path to the file on disk containing the OIDC token"
57
+ config_param :web_identity_token_file, :string, default: nil #required
58
+ desc "An IAM policy in JSON format"
59
+ config_param :policy, :string, default: nil
60
+ desc "The duration, in seconds, of the role session (900-43200)"
61
+ config_param :duration_seconds, :time, default: nil
45
62
  end
46
63
  config_section :instance_profile_credentials, multi: false do
47
64
  desc "Number of times to retry when retrieving credentials"
@@ -115,6 +132,10 @@ module Fluent
115
132
  options = {}
116
133
  credentials_options = {}
117
134
  case
135
+ when @aws_key_id && @aws_sec_key && @aws_ses_token
136
+ options[:access_key_id] = @aws_key_id
137
+ options[:secret_access_key] = @aws_sec_key
138
+ options[:session_token] = @aws_ses_token
118
139
  when @aws_key_id && @aws_sec_key
119
140
  options[:access_key_id] = @aws_key_id
120
141
  options[:secret_access_key] = @aws_sec_key
@@ -125,14 +146,34 @@ module Fluent
125
146
  credentials_options[:policy] = c.policy if c.policy
126
147
  credentials_options[:duration_seconds] = c.duration_seconds if c.duration_seconds
127
148
  credentials_options[:external_id] = c.external_id if c.external_id
128
- if c.sts_http_proxy and @region
149
+ credentials_options[:sts_endpoint_url] = c.sts_endpoint_url if c.sts_endpoint_url
150
+ if @region and c.sts_http_proxy and c.sts_endpoint_url
151
+ credentials_options[:client] = Aws::STS::Client.new(region: @region, http_proxy: c.sts_http_proxy, endpoint: c.sts_endpoint_url)
152
+ elsif c.sts_http_proxy and c.sts_endpoint_url
153
+ credentials_options[:client] = Aws::STS::Client.new(http_proxy: c.sts_http_proxy, endpoint: c.sts_endpoint_url)
154
+ elsif @region and c.sts_http_proxy
129
155
  credentials_options[:client] = Aws::STS::Client.new(region: @region, http_proxy: c.sts_http_proxy)
130
- elsif @region
131
- credentials_options[:client] = Aws::STS::Client.new(region: @region)
156
+ elsif @region and c.sts_endpoint_url
157
+ credentials_options[:client] = Aws::STS::Client.new(region: @region, endpoint: c.sts_endpoint_url)
132
158
  elsif c.sts_http_proxy
133
159
  credentials_options[:client] = Aws::STS::Client.new(http_proxy: c.sts_http_proxy)
160
+ elsif c.sts_endpoint_url
161
+ credentials_options[:client] = Aws::STS::Client.new(endpoint: c.sts_endpoint_url)
162
+ elsif @region
163
+ credentials_options[:client] = Aws::STS::Client.new(region: @region)
134
164
  end
135
165
  options[:credentials] = Aws::AssumeRoleCredentials.new(credentials_options)
166
+ when @web_identity_credentials
167
+ c = @web_identity_credentials
168
+ credentials_options[:role_arn] = c.role_arn
169
+ credentials_options[:role_session_name] = c.role_session_name
170
+ credentials_options[:web_identity_token_file] = c.web_identity_token_file
171
+ credentials_options[:policy] = c.policy if c.policy
172
+ credentials_options[:duration_seconds] = c.duration_seconds if c.duration_seconds
173
+ if @region
174
+ credentials_options[:client] = Aws::STS::Client.new(:region => @region)
175
+ end
176
+ options[:credentials] = Aws::AssumeRoleWebIdentityCredentials.new(credentials_options)
136
177
  when @instance_profile_credentials
137
178
  c = @instance_profile_credentials
138
179
  credentials_options[:retries] = c.retries if c.retries
@@ -44,12 +44,13 @@ module Fluent
44
44
  end
45
45
 
46
46
  def write(chunk)
47
+ delivery_stream_name = extract_placeholders(@delivery_stream_name, chunk)
47
48
  write_records_batch(chunk) do |batch|
48
49
  records = batch.map{|(data)|
49
50
  { data: data }
50
51
  }
51
52
  client.put_record_batch(
52
- delivery_stream_name: @delivery_stream_name,
53
+ delivery_stream_name: delivery_stream_name,
53
54
  records: records,
54
55
  )
55
56
  end
@@ -41,12 +41,13 @@ module Fluent
41
41
  end
42
42
 
43
43
  def write(chunk)
44
+ stream_name = extract_placeholders(@stream_name, chunk)
44
45
  write_records_batch(chunk) do |batch|
45
46
  records = batch.map{|(data, partition_key)|
46
47
  { data: data, partition_key: partition_key }
47
48
  }
48
49
  client.put_records(
49
- stream_name: @stream_name,
50
+ stream_name: stream_name,
50
51
  records: records,
51
52
  )
52
53
  end
@@ -43,11 +43,12 @@ module Fluent
43
43
  end
44
44
 
45
45
  def write(chunk)
46
+ stream_name = extract_placeholders(@stream_name, chunk)
46
47
  write_records_batch(chunk) do |batch|
47
48
  key = @partition_key_generator.call
48
49
  records = batch.map{|(data)|data}
49
50
  client.put_records(
50
- stream_name: @stream_name,
51
+ stream_name: stream_name,
51
52
  records: [{
52
53
  partition_key: key,
53
54
  data: aggregator.aggregate(records, key),
@@ -13,5 +13,5 @@
13
13
  # language governing permissions and limitations under the License.
14
14
 
15
15
  module FluentPluginKinesis
16
- VERSION = '3.1.0'
16
+ VERSION = '3.3.0'
17
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-kinesis
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-18 00:00:00.000000000 Z
11
+ date: 2020-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.14.10
19
+ version: 0.14.22
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.14.10
29
+ version: 0.14.22
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2'
@@ -43,6 +43,9 @@ dependencies:
43
43
  - - "!="
44
44
  - !ruby/object:Gem::Version
45
45
  version: '1.5'
46
+ - - "!="
47
+ - !ruby/object:Gem::Version
48
+ version: '1.14'
46
49
  type: :runtime
47
50
  prerelease: false
48
51
  version_requirements: !ruby/object:Gem::Requirement
@@ -56,6 +59,9 @@ dependencies:
56
59
  - - "!="
57
60
  - !ruby/object:Gem::Version
58
61
  version: '1.5'
62
+ - - "!="
63
+ - !ruby/object:Gem::Version
64
+ version: '1.14'
59
65
  - !ruby/object:Gem::Dependency
60
66
  name: aws-sdk-firehose
61
67
  requirement: !ruby/object:Gem::Requirement
@@ -69,6 +75,9 @@ dependencies:
69
75
  - - "!="
70
76
  - !ruby/object:Gem::Version
71
77
  version: '1.9'
78
+ - - "!="
79
+ - !ruby/object:Gem::Version
80
+ version: '1.15'
72
81
  type: :runtime
73
82
  prerelease: false
74
83
  version_requirements: !ruby/object:Gem::Requirement
@@ -82,6 +91,9 @@ dependencies:
82
91
  - - "!="
83
92
  - !ruby/object:Gem::Version
84
93
  version: '1.9'
94
+ - - "!="
95
+ - !ruby/object:Gem::Version
96
+ version: '1.15'
85
97
  - !ruby/object:Gem::Dependency
86
98
  name: google-protobuf
87
99
  requirement: !ruby/object:Gem::Requirement
@@ -271,11 +283,20 @@ files:
271
283
  - Rakefile
272
284
  - benchmark/task.rake
273
285
  - fluent-plugin-kinesis.gemspec
274
- - gemfiles/Gemfile.fluentd-0.14.10
286
+ - gemfiles/Gemfile.fluentd-0.14.22
287
+ - gemfiles/Gemfile.fluentd-1.11.2
288
+ - gemfiles/Gemfile.td-agent-3.1.0
275
289
  - gemfiles/Gemfile.td-agent-3.1.1
276
290
  - gemfiles/Gemfile.td-agent-3.2.0
277
291
  - gemfiles/Gemfile.td-agent-3.2.1
278
292
  - gemfiles/Gemfile.td-agent-3.3.0
293
+ - gemfiles/Gemfile.td-agent-3.4.1
294
+ - gemfiles/Gemfile.td-agent-3.5.0
295
+ - gemfiles/Gemfile.td-agent-3.5.1
296
+ - gemfiles/Gemfile.td-agent-3.6.0
297
+ - gemfiles/Gemfile.td-agent-3.7.1
298
+ - gemfiles/Gemfile.td-agent-3.8.0
299
+ - gemfiles/Gemfile.td-agent-4.0.1
279
300
  - lib/fluent/plugin/kinesis.rb
280
301
  - lib/fluent/plugin/kinesis_helper/aggregator.rb
281
302
  - lib/fluent/plugin/kinesis_helper/api.rb
@@ -296,15 +317,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
296
317
  requirements:
297
318
  - - ">="
298
319
  - !ruby/object:Gem::Version
299
- version: '2.1'
320
+ version: '2.3'
300
321
  required_rubygems_version: !ruby/object:Gem::Requirement
301
322
  requirements:
302
323
  - - ">="
303
324
  - !ruby/object:Gem::Version
304
325
  version: '0'
305
326
  requirements: []
306
- rubyforge_project:
307
- rubygems_version: 2.6.14.1
327
+ rubygems_version: 3.0.3
308
328
  signing_key:
309
329
  specification_version: 4
310
330
  summary: Fluentd output plugin that sends events to Amazon Kinesis.