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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab5ec7dc0c6834c28679c38d676abab3e80ffda7df079e038d5fcebaf2a90afb
4
- data.tar.gz: 4cdc46401d7f16db0f152cfb4da918e35ea0ebc255451526040fdc4e7225705a
3
+ metadata.gz: a3c11c5972a494975b2acfa7d7e4f67e0ca4720ff9ec78c864febf764c9b030b
4
+ data.tar.gz: f80d8c34dd0848c07029199a6c57d39e25c343e32c499ecb4d350bfd50564119
5
5
  SHA512:
6
- metadata.gz: 206db97684f6a7a4a45e56235da12e828d280b500c16ed7bab8d7a3d994dc881d28d9912d664cd9d185b338b7dfd13de47fdd02173935974223b8374281501a9
7
- data.tar.gz: 74fc9bed35c6f9666b04f88ccf1418faa6f3013c540fb9b40c7da59e925d562ba17d3d4bda34d2f510f24304c965c112b480af5c0b42a96a276113b35e7f24eb
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
 
@@ -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 = self.class.days_to_seconds(@opts.fetch(:sincedb_clean_after, 14))
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 = Settings.days_to_seconds(days)
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
@@ -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.14'
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(Settings.days_to_seconds(14)) }
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.14
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-01-27 00:00:00.000000000 Z
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