logstash-input-s3 3.8.1 → 3.8.2
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 -6
- data/logstash-input-s3.gemspec +1 -1
- data/spec/inputs/s3_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1efe9981371c5b8306ef18f09c13fff78558b66ae2ee667bd2c576b8b88218e9
|
4
|
+
data.tar.gz: 843c506610bd7ca9c48759cb7339f80e65211c17df9c3a83c8a5ca6fe850f39f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cd8360c8eafce836259fada827ab42fc1972a42cec30bafe4ed7d61bea222bcc3db0c4a1ee19471a3727dffd7e9170ad48c0fe57baff5408e76e5ea60de3d44
|
7
|
+
data.tar.gz: 2cdeb2452504940dbd999d838d1abd905108ae748c9efa7ab9788a67b9e79c139f247c360c33393ce742189e27bb3a8763bde1725c95c76145884b0aa7a54039
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 3.8.2
|
2
|
+
- Refactor: read sincedb time once per bucket listing [#233](https://github.com/logstash-plugins/logstash-input-s3/pull/233)
|
3
|
+
|
1
4
|
## 3.8.1
|
2
5
|
- Feat: cast true/false values for additional_settings [#232](https://github.com/logstash-plugins/logstash-input-s3/pull/232)
|
3
6
|
|
data/lib/logstash/inputs/s3.rb
CHANGED
@@ -139,6 +139,7 @@ class LogStash::Inputs::S3 < LogStash::Inputs::Base
|
|
139
139
|
objects = []
|
140
140
|
found = false
|
141
141
|
current_time = Time.now
|
142
|
+
sincedb_time = sincedb.read
|
142
143
|
begin
|
143
144
|
@s3bucket.objects(:prefix => @prefix).each do |log|
|
144
145
|
found = true
|
@@ -147,7 +148,7 @@ class LogStash::Inputs::S3 < LogStash::Inputs::Base
|
|
147
148
|
@logger.debug('Ignoring', :key => log.key)
|
148
149
|
elsif log.content_length <= 0
|
149
150
|
@logger.debug('Object Zero Length', :key => log.key)
|
150
|
-
elsif
|
151
|
+
elsif log.last_modified <= sincedb_time
|
151
152
|
@logger.debug('Object Not Modified', :key => log.key)
|
152
153
|
elsif log.last_modified > (current_time - CUTOFF_SECOND).utc # file modified within last two seconds will be processed in next cycle
|
153
154
|
@logger.debug('Object Modified After Cutoff Time', :key => log.key)
|
@@ -464,10 +465,7 @@ class LogStash::Inputs::S3 < LogStash::Inputs::Base
|
|
464
465
|
@sincedb_path = file
|
465
466
|
end
|
466
467
|
|
467
|
-
|
468
|
-
date > read
|
469
|
-
end
|
470
|
-
|
468
|
+
# @return [Time]
|
471
469
|
def read
|
472
470
|
if ::File.exists?(@sincedb_path)
|
473
471
|
content = ::File.read(@sincedb_path).chomp.strip
|
@@ -479,7 +477,7 @@ class LogStash::Inputs::S3 < LogStash::Inputs::Base
|
|
479
477
|
end
|
480
478
|
|
481
479
|
def write(since = nil)
|
482
|
-
since = Time.now
|
480
|
+
since = Time.now if since.nil?
|
483
481
|
::File.open(@sincedb_path, 'w') { |file| file.write(since.to_s) }
|
484
482
|
end
|
485
483
|
end
|
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.8.
|
4
|
+
s.version = '3.8.2'
|
5
5
|
s.licenses = ['Apache-2.0']
|
6
6
|
s.summary = "Streams events from files in 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
@@ -195,6 +195,7 @@ describe LogStash::Inputs::S3 do
|
|
195
195
|
it 'should log that no files were found in the bucket' do
|
196
196
|
plugin = LogStash::Inputs::S3.new(config)
|
197
197
|
plugin.register
|
198
|
+
allow(plugin.logger).to receive(:info).with(/Using the provided sincedb_path/, anything)
|
198
199
|
expect(plugin.logger).to receive(:info).with(/No files found/, anything)
|
199
200
|
expect(plugin.list_new_files).to be_empty
|
200
201
|
end
|
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.8.
|
4
|
+
version: 3.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|