logstash-input-s3-sns-sqs 1.5.2 → 1.5.3
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 +35 -6
- 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: c94472c2e0f553176174262701934a498e29b6c4
|
4
|
+
data.tar.gz: 848d9e0f416556376e0ef74d7538eae426a5121a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e2ce0d7fa0fef03d374c4a7a9d6eefcda03fe635556fd24461aed30f5083fc8b15809a063d4cdbb8c5cffa8fee6c51c698c57cfeb0d27fa3e48e86d630f9830
|
7
|
+
data.tar.gz: f50e78c06714bbc92d06f32d8e8b88bc1d18ec0980f900dea4fb13b948ffb8d1edd64dae64e0cabd093b046cc044c0fe12b5bb44cef7c764603c8acc5e413c25
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,7 @@ require "logstash/plugin_mixins/aws_config"
|
|
7
7
|
require "logstash/errors"
|
8
8
|
require 'logstash/inputs/s3sqs/patch'
|
9
9
|
require "aws-sdk"
|
10
|
+
require "stud/interval"
|
10
11
|
require 'cgi'
|
11
12
|
require 'logstash/inputs/mime/MagicgzipValidator'
|
12
13
|
|
@@ -121,6 +122,7 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
|
|
121
122
|
config :s3_role_arn, :validate => :string
|
122
123
|
# Session name to use when assuming an IAM role
|
123
124
|
config :s3_role_session_name, :validate => :string, :default => "logstash"
|
125
|
+
config :visibility_timeout, :validate => :number, :default => 600
|
124
126
|
|
125
127
|
|
126
128
|
attr_reader :poller
|
@@ -170,6 +172,8 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
|
|
170
172
|
:max_number_of_messages => 1,
|
171
173
|
# we will use the queue's setting, a good value is 10 seconds
|
172
174
|
# (to ensure fast logstash shutdown on the one hand and few api calls on the other hand)
|
175
|
+
:skip_delete => false,
|
176
|
+
:visibility_timeout => @visibility_timeout,
|
173
177
|
:wait_time_seconds => nil,
|
174
178
|
}
|
175
179
|
end
|
@@ -216,11 +220,18 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
|
|
216
220
|
filename = File.join(temporary_directory, File.basename(key))
|
217
221
|
if download_remote_file(object, filename)
|
218
222
|
if process_local_log( filename, key, folder, instance_codec, queue, bucket)
|
219
|
-
|
220
|
-
|
223
|
+
begin
|
224
|
+
FileUtils.remove_entry_secure(filename, true)
|
225
|
+
delete_file_from_bucket(object)
|
226
|
+
rescue Exception => e
|
227
|
+
@logger.debug("We had problems to delete your file", :file => filename, :error => e)
|
221
228
|
end
|
222
|
-
|
223
|
-
|
229
|
+
else
|
230
|
+
begin
|
231
|
+
FileUtils.remove_entry_secure(filename, true)
|
232
|
+
rescue Exception => e
|
233
|
+
@logger.debug("We had problems clean up your tmp dir", :file => filename, :error => e)
|
234
|
+
end
|
224
235
|
end
|
225
236
|
end
|
226
237
|
|
@@ -449,7 +460,16 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
|
|
449
460
|
# poll a message and process it
|
450
461
|
run_with_backoff do
|
451
462
|
poller.poll(polling_options) do |message|
|
452
|
-
|
463
|
+
begin
|
464
|
+
Stud.interval(@visibility_timeout - 10 ) do
|
465
|
+
@logger.info("Increasing the visibility_timeout ... ")
|
466
|
+
poller.change_message_visibility_timeout(msg, 60)
|
467
|
+
end
|
468
|
+
handle_message(message, queue, @codec.clone)
|
469
|
+
poller.delete_message(message)
|
470
|
+
rescue Exception => e
|
471
|
+
@logger.info("Error in poller block ... ", :error => e)
|
472
|
+
end
|
453
473
|
end
|
454
474
|
end
|
455
475
|
end
|
@@ -487,7 +507,16 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
|
|
487
507
|
# poll a message and process it
|
488
508
|
run_with_backoff do
|
489
509
|
poller.poll(polling_options) do |message|
|
490
|
-
|
510
|
+
begin
|
511
|
+
Stud.interval(@visibility_timeout - 10 ) do
|
512
|
+
@logger.info("Increasing the visibility_timeout ... ")
|
513
|
+
poller.change_message_visibility_timeout(msg, 60)
|
514
|
+
end
|
515
|
+
handle_message(message, queue, @codec.clone)
|
516
|
+
poller.delete_message(message)
|
517
|
+
rescue Exception => e
|
518
|
+
@logger.info("Error in poller block ... ", :error => e)
|
519
|
+
end
|
491
520
|
end
|
492
521
|
end
|
493
522
|
end
|
@@ -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.3'
|
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.3
|
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-
|
11
|
+
date: 2018-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|