logstash-input-file 4.1.14 → 4.1.15
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/filewatch/settings.rb +1 -5
- data/lib/filewatch/sincedb_record_serializer.rb +5 -1
- data/lib/jars/filewatch-1.0.1.jar +0 -0
- data/logstash-input-file.gemspec +1 -1
- data/spec/filewatch/settings_spec.rb +11 -0
- data/spec/filewatch/sincedb_record_serializer_spec.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3c11c5972a494975b2acfa7d7e4f67e0ca4720ff9ec78c864febf764c9b030b
|
4
|
+
data.tar.gz: f80d8c34dd0848c07029199a6c57d39e25c343e32c499ecb4d350bfd50564119
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '00392e4f07fe9fdfd732419c4b56b680f5b07aa7e97149ba7af91bca8aee128f396ef2330ec46814b7b3fbc9b52fcc58766a27d50b72bbf28c9b7475dc0aeda0'
|
7
|
+
data.tar.gz: 76079df610dfe177fd5c538b8ff5325d064f97826af30d441bd9abe54bfc1197f2178ba88862d6f144540a776493cce44efe130119ee8cc8e39c14492203f534
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 4.1.15
|
2
|
+
- Fixed bug in conversion of sincedb_clean_after setting [#257](https://github.com/logstash-plugins/logstash-input-file/pull/257)
|
3
|
+
|
1
4
|
## 4.1.14
|
2
5
|
- Fixed bug in delete of multiple watched files [#254](https://github.com/logstash-plugins/logstash-input-file/pull/254)
|
3
6
|
|
data/lib/filewatch/settings.rb
CHANGED
@@ -13,10 +13,6 @@ module FileWatch
|
|
13
13
|
new.add_options(opts)
|
14
14
|
end
|
15
15
|
|
16
|
-
def self.days_to_seconds(days)
|
17
|
-
(24 * 3600) * days.to_f
|
18
|
-
end
|
19
|
-
|
20
16
|
def initialize
|
21
17
|
defaults = {
|
22
18
|
:delimiter => "\n",
|
@@ -51,7 +47,7 @@ module FileWatch
|
|
51
47
|
@file_chunk_count = @opts[:file_chunk_count]
|
52
48
|
@sincedb_path = @opts[:sincedb_path]
|
53
49
|
@sincedb_write_interval = @opts[:sincedb_write_interval]
|
54
|
-
@sincedb_expiry_duration =
|
50
|
+
@sincedb_expiry_duration = @opts.fetch(:sincedb_clean_after)
|
55
51
|
@file_sort_by = @opts[:file_sort_by]
|
56
52
|
@file_sort_direction = @opts[:file_sort_direction]
|
57
53
|
self
|
@@ -5,13 +5,17 @@ module FileWatch
|
|
5
5
|
|
6
6
|
attr_reader :expired_keys
|
7
7
|
|
8
|
+
def self.days_to_seconds(days)
|
9
|
+
(24 * 3600) * days.to_f
|
10
|
+
end
|
11
|
+
|
8
12
|
def initialize(sincedb_value_expiry)
|
9
13
|
@sincedb_value_expiry = sincedb_value_expiry
|
10
14
|
@expired_keys = []
|
11
15
|
end
|
12
16
|
|
13
17
|
def update_sincedb_value_expiry_from_days(days)
|
14
|
-
@sincedb_value_expiry =
|
18
|
+
@sincedb_value_expiry = SincedbRecordSerializer.days_to_seconds(days)
|
15
19
|
end
|
16
20
|
|
17
21
|
def serialize(db, io, as_of = Time.now.to_f)
|
Binary file
|
data/logstash-input-file.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-file'
|
4
|
-
s.version = '4.1.
|
4
|
+
s.version = '4.1.15'
|
5
5
|
s.licenses = ['Apache-2.0']
|
6
6
|
s.summary = "Streams events from files"
|
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"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
describe FileWatch::Settings do
|
2
|
+
|
3
|
+
context "when create from options" do
|
4
|
+
it "doesn't convert sincedb_clean_after to seconds" do
|
5
|
+
res = FileWatch::Settings.from_options({:sincedb_clean_after => LogStash::Inputs::FriendlyDurations.call(1, "days").value})
|
6
|
+
|
7
|
+
expect(res.sincedb_expiry_duration).to eq 1 * 24 * 3600
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
@@ -9,7 +9,7 @@ module FileWatch
|
|
9
9
|
let(:io) { StringIO.new }
|
10
10
|
let(:db) { Hash.new }
|
11
11
|
|
12
|
-
subject { SincedbRecordSerializer.new(
|
12
|
+
subject { SincedbRecordSerializer.new(SincedbRecordSerializer.days_to_seconds(14)) }
|
13
13
|
|
14
14
|
context "deserialize from IO" do
|
15
15
|
it 'reads V1 records' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-file
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -214,6 +214,7 @@ files:
|
|
214
214
|
- spec/filewatch/read_mode_handlers_read_file_spec.rb
|
215
215
|
- spec/filewatch/reading_spec.rb
|
216
216
|
- spec/filewatch/rotate_spec.rb
|
217
|
+
- spec/filewatch/settings_spec.rb
|
217
218
|
- spec/filewatch/sincedb_record_serializer_spec.rb
|
218
219
|
- spec/filewatch/spec_helper.rb
|
219
220
|
- spec/filewatch/tailing_spec.rb
|
@@ -263,6 +264,7 @@ test_files:
|
|
263
264
|
- spec/filewatch/read_mode_handlers_read_file_spec.rb
|
264
265
|
- spec/filewatch/reading_spec.rb
|
265
266
|
- spec/filewatch/rotate_spec.rb
|
267
|
+
- spec/filewatch/settings_spec.rb
|
266
268
|
- spec/filewatch/sincedb_record_serializer_spec.rb
|
267
269
|
- spec/filewatch/spec_helper.rb
|
268
270
|
- spec/filewatch/tailing_spec.rb
|