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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/logstash/inputs/s3.rb +4 -2
- data/logstash-input-s3.gemspec +1 -1
- data/spec/inputs/s3_spec.rb +2 -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: edc29d7a88714576ad9dfb0dd152e5026825ba2f
|
4
|
+
data.tar.gz: faddf8e9a48bf01ea30fb1c4c77fe28bb80990e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57d6c5a51e9208297edb48168fb83d091368ac9658f4befb0c1a60af1d7f5d2065ef71ff707292a072bac9d7487b8aabdc4639fda517f6d29a5bc5fcafc6db0f
|
7
|
+
data.tar.gz: a7e0dbc17be73c37f24b5595a133b25f9f731ec8c13b882f01af2b55abf2f62e5bf6e30f7a49b4b75ebb94990cb57ba230ce83551da0cbaa29e4f3ff13b16f36
|
data/CHANGELOG.md
CHANGED
data/lib/logstash/inputs/s3.rb
CHANGED
@@ -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)
|
data/logstash-input-s3.gemspec
CHANGED
@@ -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.
|
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"
|
data/spec/inputs/s3_spec.rb
CHANGED
@@ -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.
|
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-
|
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
|