logstash-input-s3 3.1.2 → 3.1.3

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: 44b70069c72227302a7d1c75314f1c3bcc40c67d
4
- data.tar.gz: 3a42b5a34ae5df3f77732dddf7929a91d7494685
3
+ metadata.gz: edc29d7a88714576ad9dfb0dd152e5026825ba2f
4
+ data.tar.gz: faddf8e9a48bf01ea30fb1c4c77fe28bb80990e8
5
5
  SHA512:
6
- metadata.gz: be6f6e9873262bd8236ed76797c05c547c718e30a283bd5ada48b7566a1eb9da314a3e92b1859c7bd128f3f761fcb1337a6a0af6386066fb89677f4b3eec2b39
7
- data.tar.gz: 6ddb29cde0e89777bbf924620f49658ca0400c6c852322a54ec38753a627e40d7252da5d55419b1d7cf9118c2813d12cf9d4b5c11f767dbbad9e63d4189c6fe7
6
+ metadata.gz: 57d6c5a51e9208297edb48168fb83d091368ac9658f4befb0c1a60af1d7f5d2065ef71ff707292a072bac9d7487b8aabdc4639fda517f6d29a5bc5fcafc6db0f
7
+ data.tar.gz: a7e0dbc17be73c37f24b5595a133b25f9f731ec8c13b882f01af2b55abf2f62e5bf6e30f7a49b4b75ebb94990cb57ba230ce83551da0cbaa29e4f3ff13b16f36
@@ -1,3 +1,6 @@
1
+ ## 3.1.3
2
+ - The plugin will now include the s3 key in the metadata #105
3
+
1
4
  ## 3.1.2
2
5
  - Fix an issue when the remote file contains multiple blob of gz in the same file #101
3
6
  - Make the integration suite run
@@ -159,7 +159,7 @@ class LogStash::Inputs::S3 < LogStash::Inputs::Base
159
159
  # @param [Queue] Where to push the event
160
160
  # @param [String] Which file to read from
161
161
  # @return [Boolean] True if the file was completely read, false otherwise.
162
- def process_local_log(queue, filename)
162
+ def process_local_log(queue, filename, key)
163
163
  @logger.debug('Processing file', :filename => filename)
164
164
  metadata = {}
165
165
  # Currently codecs operates on bytes instead of stream.
@@ -190,6 +190,8 @@ class LogStash::Inputs::S3 < LogStash::Inputs::Base
190
190
  event.set("cloudfront_version", metadata[:cloudfront_version]) unless metadata[:cloudfront_version].nil?
191
191
  event.set("cloudfront_fields", metadata[:cloudfront_fields]) unless metadata[:cloudfront_fields].nil?
192
192
 
193
+ event.set("[@metadata][s3]", { "key" => key })
194
+
193
195
  queue << event
194
196
  end
195
197
  end
@@ -306,7 +308,7 @@ class LogStash::Inputs::S3 < LogStash::Inputs::Base
306
308
 
307
309
  filename = File.join(temporary_directory, File.basename(key))
308
310
  if download_remote_file(object, filename)
309
- if process_local_log(queue, filename)
311
+ if process_local_log(queue, filename, key)
310
312
  lastmod = object.last_modified
311
313
  backup_to_bucket(object)
312
314
  backup_to_dir(filename)
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-s3'
4
- s.version = '3.1.2'
4
+ s.version = '3.1.3'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Stream events from files from a S3 bucket."
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -213,6 +213,7 @@ describe LogStash::Inputs::S3 do
213
213
  it 'should process events' do
214
214
  events = fetch_events(config)
215
215
  expect(events.size).to eq(events_to_process)
216
+ insist { events[0].get("[@metadata][s3]") } == {"key" => log.key }
216
217
  end
217
218
 
218
219
  it "deletes the temporary file" do
@@ -261,7 +262,7 @@ describe LogStash::Inputs::S3 do
261
262
  let(:events_to_process) { 16 }
262
263
  end
263
264
  end
264
-
265
+
265
266
  context 'compressed' do
266
267
  let(:log) { double(:key => 'log.gz', :last_modified => Time.now - 2 * day) }
267
268
  let(:log_file) { File.join(File.dirname(__FILE__), '..', 'fixtures', 'compressed.log.gz') }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-24 00:00:00.000000000 Z
11
+ date: 2017-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement