fluent-plugin-elb-log 0.4.1 → 0.4.2

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
2
  SHA1:
3
- metadata.gz: f565fbbe387bad73d53cee18557d89ae0acd9f4f
4
- data.tar.gz: 6a37e1c172a8d1c5b20394dbaa38923b9b82b0e4
3
+ metadata.gz: 71fea708525f12dea801f2e95871eae3e3361faa
4
+ data.tar.gz: b43655a000f3509012cfb5530839ca88c5201fcc
5
5
  SHA512:
6
- metadata.gz: 58c8fd4c5ba84514c783afb2867438c4646a171f41d3d8fcb052db6624f807578b7bec83061f357b04791662b5a42d96cf973e0426aa5d091a5690b62625a5ba
7
- data.tar.gz: 85870e3681ddc11eb40ad22feed503aacfddd970dfc108917af87f86fd06fadba084f1f09ff4bd0d3d38a2c88d436e463bfef1403fde1c690735ddb4b8accb04
6
+ metadata.gz: a6e9a47ae3fd4cc4bc25e2c6b702bdcf6524b998f8844d7afa22f86fbb22e3220e984f4e44092a333112f64f5b081fcd8f42f174ccdbe99e3bf0770864292f15
7
+ data.tar.gz: c2654c3fc22772b407fe9ca0d06022373544e0011782b5d29f32c662b4b30a344d0fe8b8b991b0a3c0a2e0285842ba87609f3f8e075b2e9e415ca2304c32042f
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-elb-log"
7
- spec.version = "0.4.1"
7
+ spec.version = "0.4.2"
8
8
  spec.authors = ["shinsaka"]
9
9
  spec.email = ["shinx1265@gmail.com"]
10
10
  spec.summary = "Amazon ELB log input plugin"
@@ -180,10 +180,8 @@ class Fluent::Plugin::Elb_LogInput < Fluent::Plugin::Input
180
180
  def get_object_keys_from_s3
181
181
  begin
182
182
  object_keys = []
183
- get_object_list(100).each do |object|
184
- object.contents.each do |content|
185
- object_keys << content.key
186
- end
183
+ get_object_contents().each do |content|
184
+ object_keys << content.key
187
185
  end
188
186
  return object_keys
189
187
  rescue => e
@@ -209,6 +207,33 @@ class Fluent::Plugin::Elb_LogInput < Fluent::Plugin::Input
209
207
  )
210
208
  end
211
209
 
210
+ def get_object_contents()
211
+ contents = []
212
+
213
+ resp = s3_client.list_objects_v2(
214
+ bucket: @s3_bucketname,
215
+ prefix: @s3_prefix
216
+ )
217
+
218
+ loop do
219
+ resp.contents.each do |content|
220
+ contents << content
221
+ end
222
+
223
+ if !resp.is_truncated
224
+ return contents
225
+ end
226
+
227
+ resp = s3_client.list_objects_v2(
228
+ bucket: @s3_bucketname,
229
+ prefix: @s3_prefix,
230
+ continuation_token: resp.next_continuation_token
231
+ )
232
+ end
233
+
234
+ return contents
235
+ end
236
+
212
237
  def get_file_from_s3(object_name)
213
238
  begin
214
239
  log.debug "getting object from s3 name is #{object_name}"
data/test/helper.rb CHANGED
@@ -3,7 +3,9 @@ require 'test/unit'
3
3
  require 'webmock/test_unit'
4
4
  require 'simplecov'
5
5
 
6
- SimpleCov.start
6
+ SimpleCov.start do
7
+ add_filter '/test/'
8
+ end
7
9
 
8
10
  $LOAD_PATH.unshift(File.join(__dir__, '..', 'lib'))
9
11
  $LOAD_PATH.unshift(__dir__)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-elb-log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - shinsaka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-06 00:00:00.000000000 Z
11
+ date: 2017-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd