logstash-input-file 4.1.13 → 4.1.14
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab5ec7dc0c6834c28679c38d676abab3e80ffda7df079e038d5fcebaf2a90afb
|
4
|
+
data.tar.gz: 4cdc46401d7f16db0f152cfb4da918e35ea0ebc255451526040fdc4e7225705a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 206db97684f6a7a4a45e56235da12e828d280b500c16ed7bab8d7a3d994dc881d28d9912d664cd9d185b338b7dfd13de47fdd02173935974223b8374281501a9
|
7
|
+
data.tar.gz: 74fc9bed35c6f9666b04f88ccf1418faa6f3013c540fb9b40c7da59e925d562ba17d3d4bda34d2f510f24304c965c112b480af5c0b42a96a276113b35e7f24eb
|
data/CHANGELOG.md
CHANGED
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.14'
|
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"
|
@@ -90,7 +90,7 @@ module FileWatch
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
-
context "when watching a directory with files,
|
93
|
+
context "when watching a directory with files, existing content is skipped" do
|
94
94
|
let(:suffix) { "C" }
|
95
95
|
let(:actions) do
|
96
96
|
RSpec::Sequencing
|
@@ -100,11 +100,11 @@ module FileWatch
|
|
100
100
|
.then_after(0.1, "begin watching") do
|
101
101
|
tailing.watch_this(watch_dir)
|
102
102
|
end
|
103
|
-
.then_after(
|
103
|
+
.then_after(2, "add content") do
|
104
104
|
File.open(file_path, "ab") { |file| file.write("line1\nline2\n") }
|
105
105
|
end
|
106
106
|
.then("wait") do
|
107
|
-
wait(0.75).for{listener1.lines
|
107
|
+
wait(0.75).for{listener1.lines}.to eq(["line1", "line2"])
|
108
108
|
end
|
109
109
|
.then("quit") do
|
110
110
|
tailing.quit
|
@@ -4,12 +4,15 @@ require_relative 'spec_helper'
|
|
4
4
|
module FileWatch
|
5
5
|
describe WatchedFilesCollection do
|
6
6
|
let(:time) { Time.now }
|
7
|
+
let(:filepath1){"/var/log/z.log"}
|
8
|
+
let(:filepath2){"/var/log/m.log"}
|
9
|
+
let(:filepath3){"/var/log/a.log"}
|
7
10
|
let(:stat1) { double("stat1", :size => 98, :modified_at => time - 30, :identifier => nil, :inode => 234567, :inode_struct => InodeStruct.new("234567", 3, 2)) }
|
8
11
|
let(:stat2) { double("stat2", :size => 99, :modified_at => time - 20, :identifier => nil, :inode => 234568, :inode_struct => InodeStruct.new("234568", 3, 2)) }
|
9
12
|
let(:stat3) { double("stat3", :size => 100, :modified_at => time, :identifier => nil, :inode => 234569, :inode_struct => InodeStruct.new("234569", 3, 2)) }
|
10
|
-
let(:wf1) { WatchedFile.new(
|
11
|
-
let(:wf2) { WatchedFile.new(
|
12
|
-
let(:wf3) { WatchedFile.new(
|
13
|
+
let(:wf1) { WatchedFile.new(filepath1, stat1, Settings.new) }
|
14
|
+
let(:wf2) { WatchedFile.new(filepath2, stat2, Settings.new) }
|
15
|
+
let(:wf3) { WatchedFile.new(filepath3, stat3, Settings.new) }
|
13
16
|
|
14
17
|
context "sort by last_modified in ascending order" do
|
15
18
|
let(:sort_by) { "last_modified" }
|
@@ -70,5 +73,23 @@ module FileWatch
|
|
70
73
|
expect(collection.values).to eq([wf1, wf2, wf3])
|
71
74
|
end
|
72
75
|
end
|
76
|
+
|
77
|
+
context "when delete called" do
|
78
|
+
let(:sort_by) { "path" }
|
79
|
+
let(:sort_direction) { "desc" }
|
80
|
+
|
81
|
+
it "is able to delete multiple files at once" do
|
82
|
+
collection = described_class.new(Settings.from_options(:file_sort_by => sort_by, :file_sort_direction => sort_direction))
|
83
|
+
collection.add(wf1)
|
84
|
+
collection.add(wf2)
|
85
|
+
collection.add(wf3)
|
86
|
+
expect(collection.keys).to eq([filepath1, filepath2, filepath3])
|
87
|
+
|
88
|
+
collection.delete([filepath2,filepath3])
|
89
|
+
expect(collection.keys).to eq([filepath1])
|
90
|
+
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
73
94
|
end
|
74
95
|
end
|
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.14
|
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-
|
11
|
+
date: 2020-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|