logstash-input-s3-sns-sqs 1.4.5 → 1.4.6

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: 1d2ee1ae20a382ab708d3db9131f2025e238372e
4
- data.tar.gz: 49fc208ab9ba5a142d8c7573108a8184a6b6aefa
3
+ metadata.gz: b306531064b4c30538ebf2825ad8ccd3cffc1723
4
+ data.tar.gz: 3166705bd066e00607cfb5f8f6e0b5d810934ef2
5
5
  SHA512:
6
- metadata.gz: 6cb64dc332a7ffd69948d8ebe3cfa330cce023903d9d3b798f61a33effc67461780974e4f99c493a5b1d98e32a344fc516562d3832b084ec7ec1b2b8d4c4ef99
7
- data.tar.gz: c13e35a7d8937e44a020fc07fe4521585d92ce3f0d7f0077ebde071d11b1b2c113376d2b5103c3d13111daf040cf8fda5695693bb7069e6cf242dff600d45ed0
6
+ metadata.gz: ee7ba71f4ed496dc0cc109ea1834d0da58d112c320fb6c8a80f33ee65ab9a1f0746976be6ad32f934c4f80f9a3c0688f94a64064f44d665bbce3f3d19bb699b0
7
+ data.tar.gz: b614c2c3945819b6e95052f1770920d57b83d5afb9300836e6af1375b45c93c15c7117b14fdd33372edbe746cc796e5b967dc75b131b03d9eb0e7ba73cd65797
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 1.4.6
2
+ - BugFix: jRuby > 2 : No return from block
3
+ - BugFix: No exit on gzip error
1
4
  ## 1.4.5
2
5
  - BugFix: undeclared var in rescue
3
6
  ## 1.4.4
@@ -98,9 +98,6 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
98
98
 
99
99
  default :codec, "plain"
100
100
 
101
- # The message string to use in the event.
102
- config :message, :validate => :string, :default => "Hello World!"
103
-
104
101
  # Name of the SQS Queue to pull messages from. Note that this is just the name of the queue, not the URL or ARN.
105
102
  config :queue, :validate => :string, :required => true
106
103
  config :s3_key_prefix, :validate => :string, :default => ''
@@ -148,22 +145,20 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
148
145
  end
149
146
 
150
147
  def setup_queue
151
- begin
152
- aws_sqs_client = Aws::SQS::Client.new(aws_options_hash)
153
- queue_url = aws_sqs_client.get_queue_url({ queue_name: @queue, queue_owner_aws_account_id: @queue_owner_aws_account_id})[:queue_url]
154
- @poller = Aws::SQS::QueuePoller.new(queue_url, :client => aws_sqs_client)
155
- if s3_access_key_id and s3_secret_access_key
156
- @logger.debug("Using S3 Credentials from config", :ID => aws_options_hash.merge(:access_key_id => s3_access_key_id, :secret_access_key => s3_secret_access_key) )
157
- @s3_client = Aws::S3::Client.new(aws_options_hash.merge(:access_key_id => s3_access_key_id, :secret_access_key => s3_secret_access_key))
158
- else
159
- @s3_client = Aws::S3::Client.new(aws_options_hash)
160
- end
161
-
162
- @s3_resource = get_s3object
163
- rescue Aws::SQS::Errors::ServiceError => e
164
- @logger.error("Cannot establish connection to Amazon SQS", :error => e)
165
- raise LogStash::ConfigurationError, "Verify the SQS queue name and your credentials"
148
+ aws_sqs_client = Aws::SQS::Client.new(aws_options_hash)
149
+ queue_url = aws_sqs_client.get_queue_url({ queue_name: @queue, queue_owner_aws_account_id: @queue_owner_aws_account_id})[:queue_url]
150
+ @poller = Aws::SQS::QueuePoller.new(queue_url, :client => aws_sqs_client)
151
+ if s3_access_key_id and s3_secret_access_key
152
+ @logger.debug("Using S3 Credentials from config", :ID => aws_options_hash.merge(:access_key_id => s3_access_key_id, :secret_access_key => s3_secret_access_key) )
153
+ @s3_client = Aws::S3::Client.new(aws_options_hash.merge(:access_key_id => s3_access_key_id, :secret_access_key => s3_secret_access_key))
154
+ else
155
+ @s3_client = Aws::S3::Client.new(aws_options_hash)
166
156
  end
157
+
158
+ @s3_resource = get_s3object
159
+ rescue Aws::SQS::Errors::ServiceError => e
160
+ @logger.error("Cannot establish connection to Amazon SQS", :error => e)
161
+ raise LogStash::ConfigurationError, "Verify the SQS queue name and your credentials"
167
162
  end
168
163
 
169
164
  def polling_options
@@ -351,8 +346,7 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
351
346
  block.call(line)
352
347
  end
353
348
  rescue ZipException => e
354
- @logger.error("Gzip codec: We cannot uncompress the gzip file", :filename => filename)
355
- raise e
349
+ @logger.error("Gzip codec: We cannot uncompress the gzip file", :filename => filename, error => e)
356
350
  ensure
357
351
  buffered.close unless buffered.nil?
358
352
  decoder.close unless decoder.nil?
@@ -473,10 +467,14 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
473
467
  private
474
468
  def hash_key_is_regex(myhash)
475
469
  myhash.default_proc = lambda do |hash, lookup|
470
+ result=nil
476
471
  hash.each_pair do |key, value|
477
- return value if %r[#{key}] =~ lookup.to_s
472
+ if %r[#{key}] =~ lookup
473
+ result=value
474
+ break
475
+ end
478
476
  end
479
- return nil
477
+ result
480
478
  end
481
479
  end
482
480
  end # class
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-s3-sns-sqs'
3
- s.version = '1.4.5'
3
+ s.version = '1.4.6'
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-s3-sns-sqs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Herweg