fluent-plugin-cloudwatch-logs 0.13.4 → 0.14.0

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
  SHA256:
3
- metadata.gz: c69c4ace1ac8f156cf91e67aad9587082e37939eb2d38a5948400434f2ad7550
4
- data.tar.gz: 7d28b42e100ce69cdae91cda6771cc349803e45c1c89bca5a2dc634bef094b4f
3
+ metadata.gz: ecdab23fc3b9c43ff71a49331694a6f9f88b0a7a27c70259b1a5b4c55894744d
4
+ data.tar.gz: 4197f274338c7134601dccfbb3e56b8672923b602f59e8fccc2d3ed43c9e4c6b
5
5
  SHA512:
6
- metadata.gz: cbba39e93f58da219d19726a1e8782576cb786e0cc6aac8306e03771fd7efaf967b08cae27aa9459c08b79316392f25e2c4ab3c91f65feaf13a1db89c4d97cca
7
- data.tar.gz: b0113d75d4be4acf8b2f363d678ce6aa209be6b4c2a8c47edbf7a0c319d80656b12443c5f1948748813466d17feb871b0b92f75c3c9ca75a7d0921f4a00972d7
6
+ metadata.gz: 228c5d942bba9b410f926136c59a5ad65482580d67076f8703e5dbf7b1cd778beb447b2c175d07c20d20616a2dad8d74607db2665393387edda0e534a7da8362
7
+ data.tar.gz: 6e3cd9935e8c64b390877240a18175d8b1dd0ea3df34300658ebe66df22d728e0a45beba10ac8cbc63f9159d5a725abedcd4f62cdd7b244bd5c25e17a812153a
@@ -8,7 +8,7 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: [ '2.4', '2.5', '2.6', '2.7' ]
11
+ ruby: [ '2.5', '2.6', '2.7', '3.0' ]
12
12
  os:
13
13
  - ubuntu-latest
14
14
  name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
@@ -8,7 +8,7 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: [ '2.4', '2.5', '2.6', '2.7' ]
11
+ ruby: [ '2.5', '2.6', '2.7', '3.0' ]
12
12
  os:
13
13
  - windows-latest
14
14
  name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
data/README.md CHANGED
@@ -16,10 +16,18 @@
16
16
 
17
17
  ## Installation
18
18
 
19
+ ### For Fluentd
20
+
19
21
  ```sh
20
22
  gem install fluent-plugin-cloudwatch-logs
21
23
  ```
22
24
 
25
+ ### For td-agent
26
+
27
+ ```sh
28
+ td-agent-gem install fluent-plugin-cloudwatch-logs
29
+ ```
30
+
23
31
  ## Preparation
24
32
 
25
33
  Create IAM user with a policy like the following:
@@ -444,10 +452,8 @@ In more detail, please refer to [the officilal document for built-in placeholder
444
452
 
445
453
  * out_cloudwatch_logs
446
454
  * if the data is too big for API, split into multiple requests
447
- * format
448
455
  * check data size
449
456
  * in_cloudwatch_logs
450
- * format
451
457
  * fallback to start_time because next_token expires after 24 hours
452
458
 
453
459
  ## Contributing
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "test-unit"
26
26
  spec.add_development_dependency "test-unit-rr"
27
27
  spec.add_development_dependency "mocha"
28
+ spec.add_development_dependency "nokogiri"
28
29
  end
@@ -2,7 +2,7 @@ module Fluent
2
2
  module Plugin
3
3
  module Cloudwatch
4
4
  module Logs
5
- VERSION = "0.13.4"
5
+ VERSION = "0.14.0"
6
6
  end
7
7
  end
8
8
  end
@@ -17,6 +17,9 @@ module Fluent::Plugin
17
17
  config_param :aws_use_sts, :bool, default: false
18
18
  config_param :aws_sts_role_arn, :string, default: nil
19
19
  config_param :aws_sts_session_name, :string, default: 'fluentd'
20
+ config_param :aws_sts_external_id, :string, default: nil
21
+ config_param :aws_sts_policy, :string, default: nil
22
+ config_param :aws_sts_duration_seconds, :time, default: nil
20
23
  config_param :aws_sts_endpoint_url, :string, default: nil
21
24
  config_param :region, :string, default: nil
22
25
  config_param :endpoint, :string, default: nil
@@ -88,7 +91,10 @@ module Fluent::Plugin
88
91
  Aws.config[:region] = options[:region]
89
92
  credentials_options = {
90
93
  role_arn: @aws_sts_role_arn,
91
- role_session_name: @aws_sts_session_name
94
+ role_session_name: @aws_sts_session_name,
95
+ external_id: @aws_sts_external_id,
96
+ policy: @aws_sts_policy,
97
+ duration_seconds: @aws_sts_duration_seconds
92
98
  }
93
99
  credentials_options[:sts_endpoint_url] = @aws_sts_endpoint_url if @aws_sts_endpoint_url
94
100
  if @region and @aws_sts_endpoint_url
@@ -272,6 +278,7 @@ module Fluent::Plugin
272
278
  log_next_token = next_token(log_stream_name)
273
279
  end
274
280
  request[:next_token] = log_next_token if !log_next_token.nil? && !log_next_token.empty?
281
+ request[:start_from_head] = true if read_from_head?(log_next_token)
275
282
  response = @logs.get_log_events(request)
276
283
  if valid_next_token(log_next_token, response.next_forward_token)
277
284
  if @use_log_group_name_prefix
@@ -285,6 +292,10 @@ module Fluent::Plugin
285
292
  end
286
293
  end
287
294
 
295
+ def read_from_head?(next_token)
296
+ (!next_token.nil? && !next_token.empty?) || @start_time || @end_time
297
+ end
298
+
288
299
  def describe_log_streams(log_stream_name_prefix, log_streams = nil, next_token = nil, log_group_name=nil)
289
300
  throttling_handler('describe_log_streams') do
290
301
  request = {
@@ -19,6 +19,9 @@ module Fluent::Plugin
19
19
  config_param :aws_use_sts, :bool, default: false
20
20
  config_param :aws_sts_role_arn, :string, default: nil
21
21
  config_param :aws_sts_session_name, :string, default: 'fluentd'
22
+ config_param :aws_sts_external_id, :string, default: nil
23
+ config_param :aws_sts_policy, :string, default: nil
24
+ config_param :aws_sts_duration_seconds, :time, default: nil
22
25
  config_param :aws_sts_endpoint_url, :string, default: nil
23
26
  config_param :region, :string, :default => nil
24
27
  config_param :endpoint, :string, :default => nil
@@ -123,7 +126,10 @@ module Fluent::Plugin
123
126
  Aws.config[:region] = options[:region]
124
127
  credentials_options = {
125
128
  role_arn: @aws_sts_role_arn,
126
- role_session_name: @aws_sts_session_name
129
+ role_session_name: @aws_sts_session_name,
130
+ external_id: @aws_sts_external_id,
131
+ policy: @aws_sts_policy,
132
+ duration_seconds: @aws_sts_duration_seconds
127
133
  }
128
134
  credentials_options[:sts_endpoint_url] = @aws_sts_endpoint_url if @aws_sts_endpoint_url
129
135
  if @region and @aws_sts_endpoint_url
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-cloudwatch-logs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.4
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-19 00:00:00.000000000 Z
11
+ date: 2021-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: nokogiri
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description:
112
126
  email:
113
127
  - ryota.arai@gmail.com
@@ -119,7 +133,6 @@ files:
119
133
  - ".github/workflows/linux.yml"
120
134
  - ".github/workflows/windows.yml"
121
135
  - ".gitignore"
122
- - ".travis.yml"
123
136
  - Gemfile
124
137
  - ISSUE_TEMPLATE.md
125
138
  - LICENSE.txt
@@ -153,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
166
  - !ruby/object:Gem::Version
154
167
  version: '0'
155
168
  requirements: []
156
- rubygems_version: 3.1.2
169
+ rubygems_version: 3.2.15
157
170
  signing_key:
158
171
  specification_version: 4
159
172
  summary: CloudWatch Logs Plugin for Fluentd
data/.travis.yml DELETED
@@ -1,8 +0,0 @@
1
- sudo: false
2
- language: ruby
3
-
4
- rvm:
5
- - 2.6
6
- - 2.5
7
- - 2.4
8
- - 2.3