logstash-input-sqs_s3 1.1.14 → 1.1.15

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
  SHA256:
3
- metadata.gz: 7c7b1edc70467ae870ad4e0df52052b8611e8dd765d223fbf3e90eb9ec560d25
4
- data.tar.gz: 7a01f9c7f382a57295698ecb3e9ec6e2b8d20fe6837b7d3c8466441e6445d4eb
3
+ metadata.gz: 7810b377cc95a8256dc0b9f331cf0b99cb0567fbc87e82dba5f586e9454d87a8
4
+ data.tar.gz: 7e8533137aa8aac6d3f47b0ba58835f95dc1a34dc088e498a767bdf7358d49d3
5
5
  SHA512:
6
- metadata.gz: e84502589a34f8bc1c1b97e71d023924dcd70e420f192abce805c454865c31e650600ce456101095579944b8ca1af5dd233ff57f67e8cf523ba73ec1f85dd964
7
- data.tar.gz: 2a62a8259dad9ada95048376c614487780659ef78371ca7c71b8aaf60566f9d587713a7e4f683db39d50339cb1e82ee237fd76c7866fb8aa85e08de177b07c7c
6
+ metadata.gz: 6fb3e428faa96009cbe150a0317c9c584113170a92ad908b37399f665ea2c7797db5bad48948a5c8fec49b21d47acf7fb5fd8b5dc5d0b84906c0f04badb380b1
7
+ data.tar.gz: 4cc96ead08ac6c7e59c0ab5c8df323dabd99dddfe94be7d899145c91c93f4e8c8d3c48cd5c964bd85bb341185fd99271d83bb65baa5ebf403234704a64c31a04
@@ -1,3 +1,6 @@
1
+ ## 1.1.15
2
+ - Fixed throttle error
3
+
1
4
  ## 1.1.14
2
5
  - Fixed compilation error
3
6
 
@@ -193,7 +193,7 @@ class LogStash::Inputs::SQSS3 < LogStash::Inputs::Threadable
193
193
  # assess currently running load (in MB)
194
194
  @current_load += (record['s3']['object']['size'].to_f / 1000000)
195
195
 
196
- lines = body.read.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: "\u2370")
196
+ lines = body.read.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: "\u2370").split(/\n/)
197
197
 
198
198
  # Set the codec to json if required, otherwise the default is plain text
199
199
  if response.content_type == "application/json" then
@@ -201,13 +201,11 @@ class LogStash::Inputs::SQSS3 < LogStash::Inputs::Threadable
201
201
 
202
202
  if response.content_encoding != "gzip" then
203
203
  # If it's json in plain text, need to remove whitespaces
204
- lines = lines.gsub(/\s+/, "").split(/\n/)
205
- else
206
- lines = lines.split(/\n/)
204
+ # TODO...
207
205
  end
208
206
  else
209
207
  @codec = @plainCodec
210
- lines = lines.split(/\n/)
208
+ #lines = lines.split(/\n/)
211
209
  end
212
210
 
213
211
  lines.each do |line|
@@ -259,15 +257,15 @@ class LogStash::Inputs::SQSS3 < LogStash::Inputs::Threadable
259
257
  # Throttle requests is overloaded by big files
260
258
  if @current_load > @max_load_before_throttling/1000000 then
261
259
  throttle_seconds_sleep = @seconds_to_throttle * (@current_load / (@max_load_before_throttling.to_f/1000000)).floor
262
- @logger.warn("**********Current load has exceeded " + (@max_load_before_throttling.to_f/1000000).to_s + " MB. Load is currently: " + @current_load.to_s + ". Throttling back by " + throttle_seconds_sleep)
260
+ @logger.warn("**********Current load has exceeded " + (@max_load_before_throttling.to_f/1000000).to_s + " MB. Load is currently: " + @current_load.to_s + ". Throttling back by " + throttle_seconds_sleep.to_s)
263
261
 
262
+ # Cap the throttle time to 1 min
264
263
  if(throttle_seconds_sleep != 0) then
265
- sleep(throttle_seconds_sleep)
266
- end
267
-
268
- # Cap the throttle time to 2 min
269
- if(throttle_seconds_sleep > 120) then
270
- sleep(120)
264
+ if(throttle_seconds_sleep > 60) then
265
+ sleep(60)
266
+ else
267
+ sleep(throttle_seconds_sleep)
268
+ end
271
269
  end
272
270
  end
273
271
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-sqs_s3'
3
- s.version = '1.1.14'
3
+ s.version = '1.1.15'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "Get logs from AWS s3 buckets as issued by an object-created event via sqs."
6
6
  s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program. Full credit goes to Heiko Finzel. Republishing this gem to support Logstash 5."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-sqs_s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.14
4
+ version: 1.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heiko Finzel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-15 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
  requirement: !ruby/object:Gem::Requirement