logstash-input-s3-sns-sqs 2.2.2 → 2.2.3.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/lib/logstash/inputs/s3snssqs.rb +62 -15
- data/logstash-input-s3-sns-sqs.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '090be2e58313901bc0c357064df7955b63e3a8d2f843bb2bac3a4edd298aac5a'
|
4
|
+
data.tar.gz: ba639c3850880cfa1e46f6eead5de39268987fa83a7de3255106a133bd47c211
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a80d28f30b0fcd0885fb4a5e66e06282d577e3ea3b2c7f785f1de48d686c610f2c18e88e023ca06b1a6a22ccd6c27a031e445f94df086cdbed71ec75af4bd33b
|
7
|
+
data.tar.gz: abf25aa9f2001909651fd083abd56d2eea04e0667e3dc496fbd7e93b0e5d7a4b38063fe944ef72f707aed6353af3a2a689978cc8c3aee46c1656c549f4870982
|
data/CHANGELOG.md
CHANGED
@@ -329,25 +329,72 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
|
|
329
329
|
# --- END plugin interface ------------------------------------------#
|
330
330
|
|
331
331
|
private
|
332
|
+
Aws.config.update({
|
333
|
+
http_open_timeout: 60,
|
334
|
+
http_read_timeout: 120,
|
335
|
+
retry_limit: 5, # Increase the retry limit
|
336
|
+
retry_backoff: lambda { |c| sleep(2 ** c.retries) } # Exponential backoff
|
337
|
+
})
|
338
|
+
|
332
339
|
def run_worker_thread(queue, thread_id)
|
333
340
|
Thread.new do
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
341
|
+
begin
|
342
|
+
LogStash::Util.set_thread_name("Worker #{@id}/#{thread_id}")
|
343
|
+
@logger.info("[#{Thread.current[:name]}] started (#{Time.now})") #PROFILING
|
344
|
+
temporary_directory = Dir.mktmpdir("#{@temporary_directory}/")
|
345
|
+
@sqs_poller.run do |record|
|
346
|
+
begin
|
347
|
+
throw :skip_delete if stop?
|
348
|
+
# record is a valid object with the keys ":bucket", ":key", ":size"
|
349
|
+
record[:local_file] = File.join(temporary_directory, File.basename(record[:key]))
|
350
|
+
if @s3_downloader.copy_s3object_to_disk(record)
|
351
|
+
completed = catch(:skip_delete) do
|
352
|
+
@logger.debug("[#{Thread.current[:name]}] processing record: #{record}")
|
353
|
+
process(record, queue)
|
354
|
+
end
|
355
|
+
@s3_downloader.cleanup_local_object(record)
|
356
|
+
# re-throw if necessary:
|
357
|
+
throw :skip_delete unless completed
|
358
|
+
@s3_downloader.move_s3object(record)
|
359
|
+
@s3_downloader.cleanup_s3object(record)
|
360
|
+
end
|
361
|
+
rescue Seahorse::Client::NetworkingError => e
|
362
|
+
@logger.error("[#{Thread.current[:name]}] Networking error inside poller loop: #{e.message}")
|
363
|
+
@retry_count ||= 0
|
364
|
+
if @retry_count < 5
|
365
|
+
@retry_count += 1
|
366
|
+
sleep(2 ** @retry_count) # Exponential backoff
|
367
|
+
logger.info("[#{Thread.current[:name]}] Retry #{retry_count} of 5 for networking error")
|
368
|
+
retry
|
369
|
+
else
|
370
|
+
@logger.error("[#{Thread.current[:name]}] Exceeded retry limit for networking error: #{e.message}")
|
371
|
+
@received_stop.make_true
|
372
|
+
raise
|
373
|
+
end
|
374
|
+
rescue StandardError => e
|
375
|
+
@logger.error("[#{Thread.current[:name]}] Error processing record inside poller loop: #{e.message}")
|
376
|
+
@logger.error(e.backtrace.join("\n"))
|
377
|
+
@received_stop.make_true
|
378
|
+
raise
|
344
379
|
end
|
345
|
-
@s3_downloader.cleanup_local_object(record)
|
346
|
-
# re-throw if necessary:
|
347
|
-
throw :skip_delete unless completed
|
348
|
-
@s3_downloader.move_s3object(record)
|
349
|
-
@s3_downloader.cleanup_s3object(record)
|
350
380
|
end
|
381
|
+
rescue Seahorse::Client::NetworkingError => e
|
382
|
+
@logger.error("Networking error in thread management: #{e.message}")
|
383
|
+
@retry_count ||= 0
|
384
|
+
if @retry_count < 5
|
385
|
+
@retry_count += 1
|
386
|
+
sleep(2 ** @retry_count) # Exponential backoff
|
387
|
+
logger.info("[#{Thread.current[:name]}] Retry #{retry_count} of 5 for networking error")
|
388
|
+
retry
|
389
|
+
else
|
390
|
+
@logger.error("Exceeded retry limit for networking error: #{e.message}")
|
391
|
+
@received_stop.make_true
|
392
|
+
raise
|
393
|
+
end
|
394
|
+
rescue StandardError => e
|
395
|
+
@logger.error("Unexpected error in thread management: #{e.message}")
|
396
|
+
@received_stop.make_true
|
397
|
+
raise
|
351
398
|
end
|
352
399
|
end
|
353
400
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-input-s3-sns-sqs'
|
3
|
-
s.version = '2.2.
|
3
|
+
s.version = '2.2.3.pre'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = "Get logs from AWS s3 buckets as issued by an object-created event via sns -> 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"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-s3-sns-sqs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.3.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Herweg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -277,9 +277,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
277
277
|
version: '0'
|
278
278
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
279
279
|
requirements:
|
280
|
-
- - "
|
280
|
+
- - ">"
|
281
281
|
- !ruby/object:Gem::Version
|
282
|
-
version:
|
282
|
+
version: 1.3.1
|
283
283
|
requirements: []
|
284
284
|
rubygems_version: 3.2.29
|
285
285
|
signing_key:
|