logstash-input-s3-sns-sqs 1.1.7 → 1.1.8

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: cbba025cb4e274be8fd5af60c33fdc445486831c
4
- data.tar.gz: 1aea14626b1290ca3837fea2cd8b35dee986b841
3
+ metadata.gz: 3b47498a9996e26b8c9c26fa4f0b8b4162276a15
4
+ data.tar.gz: 63f8aa74667466c11584aac319ef43028f386a49
5
5
  SHA512:
6
- metadata.gz: a7ad292c17c49d1b9a0fa3c8ab9f454a026b38defdd73007dde13f6349f358a927da92bba46f8c082d269a1464431ba8d114d844c44a4383c8b43b1940026c0a
7
- data.tar.gz: 5c969909a581f9aeb3d1704310a0556a27ed2936a73e3c0a5b2a9590801a63bbdf6fd16d5797ff79af3f87855b541614fc155acf3ae46da58ef19991073e6e5a
6
+ metadata.gz: 9b4ce293106f3dc37405c52d6b571aea478bb65f4deea3642da7e72e1cc49120962fca54e3ae84b4438d39224f42c5b41dd7d9da00103e07889866152eeb4f68
7
+ data.tar.gz: aa5d8b70deae51d4161d182dfd425cc8d2c49d5b595c78a5d8608426cd9bf6fe284c372e4aa28528f0e01235ec80cbee3412f42623576ab448bb7004c5beb4ca
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ ## 1.1.8
2
+ - Add config switch for delivery with or without SNS
1
3
  ## 1.1.6
2
4
  - Fix a nil exception in message parsing
3
5
  ## 1.1.5
@@ -93,6 +93,8 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
93
93
  config :queue_owner_aws_account_id, :validate => :string, :required => false
94
94
  # Whether to delete files from S3 after processing.
95
95
  config :delete_on_success, :validate => :boolean, :default => false
96
+ # Whether the event is processed though an SNS to SQS. (S3>SNS>SQS = true |S3>SQS=false)
97
+ config :from_sns, :validate => :boolean, :default => true
96
98
 
97
99
  attr_reader :poller
98
100
  attr_reader :s3
@@ -129,14 +131,16 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
129
131
  def handle_message(message, queue)
130
132
  hash = JSON.parse message.body
131
133
  @logger.debug("handle_message", :hash => hash, :message => message)
134
+ #If send via sns there is an additional JSON layer
135
+ if @from_sns then
136
+ hash = JSON.parse(hash['Message'])
137
+ end
132
138
  # there may be test events sent from the s3 bucket which won't contain a Records array,
133
139
  # we will skip those events and remove them from queue
134
- if hash['Message'].present?
135
- message = JSON.parse(hash['Message'])
136
- if message['Records'] then
140
+ if hash['Records'] then
137
141
  # typically there will be only 1 record per event, but since it is an array we will
138
142
  # treat it as if there could be more records
139
- message['Records'].each do |record|
143
+ hash['Records'].each do |record|
140
144
  @logger.debug("We found a record", :record => record)
141
145
  # in case there are any events with Records that aren't s3 object-created events and can't therefore be
142
146
  # processed by this plugin, we will skip them and remove them from queue
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-s3-sns-sqs'
3
- s.version = '1.1.7'
3
+ s.version = '1.1.8'
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.1.7
4
+ version: 1.1.8
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-02-17 00:00:00.000000000 Z
11
+ date: 2018-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement