logstash-input-s3-sns-sqs 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/logstash/inputs/s3snssqs.rb +37 -15
- data/logstash-input-s3-sns-sqs.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 551338b8aa2fab2c80ffe77647e9b5b23f325ceb
|
4
|
+
data.tar.gz: d47bfd42d5d4be0755ebac6cc584791a817412a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba84a290bfd425ef85b4096178013db7c12d6e9796fccef617655f7e8d030d7f32a151d32dab4cb1fc898aa2ff3ec03a68c5e13d2d5d6d6b08323cd30192fbc9
|
7
|
+
data.tar.gz: b30d9286f67efd2efc329796b60ae4cf7899c3edbfa6848d9c7e19997d54c99d2c89c1cef6e555bcbc78590f64af7275a93598d28c13fefae12687fb3776c142
|
data/CHANGELOG.md
CHANGED
@@ -113,7 +113,7 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
|
|
113
113
|
# Whether the event is processed though an SNS to SQS. (S3>SNS>SQS = true |S3>SQS=false)
|
114
114
|
config :from_sns, :validate => :boolean, :default => true
|
115
115
|
# To run in multiple threads use this
|
116
|
-
config :consumer_threads, :validate => :number
|
116
|
+
config :consumer_threads, :validate => :number
|
117
117
|
config :temporary_directory, :validate => :string, :default => File.join(Dir.tmpdir, "logstash")
|
118
118
|
# The AWS IAM Role to assume, if any.
|
119
119
|
# This is used to generate temporary credentials typically for cross-account access.
|
@@ -305,10 +305,10 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
|
|
305
305
|
event.set("cloudfront_version", metadata[:cloudfront_version]) unless metadata[:cloudfront_version].nil?
|
306
306
|
event.set("cloudfront_fields", metadata[:cloudfront_fields]) unless metadata[:cloudfront_fields].nil?
|
307
307
|
|
308
|
-
event.set("[@metadata][s3]",
|
309
|
-
event.set("[@metadata][s3]",
|
310
|
-
event.set("[@metadata][s3]",
|
311
|
-
|
308
|
+
event.set("[@metadata][s3][object_key]", key)
|
309
|
+
event.set("[@metadata][s3][bucket_name]", bucket)
|
310
|
+
event.set("[@metadata][s3][object_folder]", folder)
|
311
|
+
@logger.debug('add metadata', :object_key => key, :bucket => bucket, :folder => folder)
|
312
312
|
queue << event
|
313
313
|
end
|
314
314
|
end
|
@@ -432,21 +432,43 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
|
|
432
432
|
|
433
433
|
public
|
434
434
|
def run(queue)
|
435
|
-
|
436
|
-
|
437
|
-
|
435
|
+
if @consumer_threads
|
436
|
+
# ensure we can stop logstash correctly
|
437
|
+
@runner_threads = consumer_threads.times.map { |consumer| thread_runner(queue) }
|
438
|
+
@runner_threads.each { |t| t.join }
|
439
|
+
else
|
440
|
+
#Fallback to simple single thread worker
|
441
|
+
# ensure we can stop logstash correctly
|
442
|
+
poller.before_request do |stats|
|
443
|
+
if stop? then
|
444
|
+
@logger.warn("issuing :stop_polling on stop?", :queue => @queue)
|
445
|
+
# this can take up to "Receive Message Wait Time" (of the sqs queue) seconds to be recognized
|
446
|
+
throw :stop_polling
|
447
|
+
end
|
448
|
+
end
|
449
|
+
# poll a message and process it
|
450
|
+
run_with_backoff do
|
451
|
+
poller.poll(polling_options) do |message|
|
452
|
+
handle_message(message, queue, @codec.clone)
|
453
|
+
end
|
454
|
+
end
|
455
|
+
end
|
438
456
|
end
|
439
457
|
|
440
458
|
public
|
441
459
|
def stop
|
442
|
-
@
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
460
|
+
if @consumer_threads
|
461
|
+
@runner_threads.each do |c|
|
462
|
+
begin
|
463
|
+
@logger.info("Stopping thread ... ", :thread => c.inspect)
|
464
|
+
c.wakeup
|
465
|
+
rescue
|
466
|
+
@logger.error("Cannot stop thread ... try to kill him", :thread => c.inspect)
|
467
|
+
c.kill
|
468
|
+
end
|
449
469
|
end
|
470
|
+
else
|
471
|
+
@logger.warn("Stopping all threads?", :queue => @queue)
|
450
472
|
end
|
451
473
|
end
|
452
474
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-input-s3-sns-sqs'
|
3
|
-
s.version = '1.5.
|
3
|
+
s.version = '1.5.2'
|
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 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: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Herweg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|