logstash-input-file 4.1.0 → 4.1.1

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: f7dc40f218316d0466dc4e5195095a197f08a079e2ecdf7f8f6c24bb86bf1fa1
4
- data.tar.gz: e44ef70fc261926779276c04010ea32326988648a535d9088af691835153ebcb
3
+ metadata.gz: f4177a21fb94dc920a0226ca698ed1bf5a6d96203a2582de150f1b1984b6ab8d
4
+ data.tar.gz: 8cdbb99975efb2bda21ed8d1745f5f5f668a6275c89e35718e2a312365cdfd5a
5
5
  SHA512:
6
- metadata.gz: 6fb28fc538b07df9b7a39d0cdfa47979afee706bc98b7d718bbc43080e1ab7ce49492cca594f9a07876aa52cca7db1ca81fe47243bc9500af6ab565a2a0568e1
7
- data.tar.gz: e13d85b4050710ba6fcd7492bf961ef4b6814bb4ba723642d3b96ae56a3e6291724ce893984cfb62e64b2c7225263ef1d49ed656f676afd48be1cf47df60a59a
6
+ metadata.gz: 4552c42974950d4f9490a13883ab77118e21b1f54fa1b7d3cfd83e99191660f15811df0364fe4ee8948fbffa7370aacc67ddc965dc2d02b44992586392bd9b63
7
+ data.tar.gz: '00287236b17611e36d6754a265507aa6a31c18e76152e4265853ca7e1c36870865d298e66db905b87dd860b769f754a745abbf4f74eafb2511f91341d3a71c2a'
@@ -1,3 +1,9 @@
1
+ ## 4.1.1
2
+ - Fix JAR_VERSION read problem, prevented Logstash from starting.
3
+ [Issue #180](https://github.com/logstash-plugins/logstash-input-file/issues/180)
4
+ - Fix sincedb write error when using /dev/null, repeatedly causes a plugin restart.
5
+ [Issue #182](https://github.com/logstash-plugins/logstash-input-file/issues/182)
6
+
1
7
  ## 4.1.0
2
8
  - Move Filewatch code into the plugin folder, rework Filewatch code to use
3
9
  Logstash facilities like logging and environment.
@@ -30,7 +30,7 @@ module FileWatch
30
30
  end
31
31
  end
32
32
 
33
- jar_version = IO.read("JAR_VERSION").strip
33
+ jar_version = Pathname.new(__FILE__).dirname.join("../../JAR_VERSION").realpath.read.strip
34
34
 
35
35
  require "java"
36
36
  require_relative "../../lib/jars/filewatch-#{jar_version}.jar"
@@ -207,7 +207,7 @@ module FileWatch
207
207
  end
208
208
 
209
209
  def non_atomic_write
210
- IO.open(@full_path, 0) do |io|
210
+ IO.open(IO.sysopen(@full_path, "w+")) do |io|
211
211
  @serializer.serialize(@sincedb, io)
212
212
  end
213
213
  end
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.0'
4
+ s.version = '4.1.1'
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"
@@ -55,6 +55,22 @@ module FileWatch
55
55
  end
56
56
  end
57
57
 
58
+ context "when watching a directory with files and sincedb_path is /dev/null or NUL" do
59
+ let(:directory) { Stud::Temporary.directory }
60
+ let(:sincedb_path) { File::NULL }
61
+ let(:watch_dir) { ::File.join(directory, "*.log") }
62
+ let(:file_path) { ::File.join(directory, "1.log") }
63
+
64
+ it "the file is read" do
65
+ File.open(file_path, "wb") { |file| file.write("line1\nline2\n") }
66
+ actions.activate
67
+ reading.watch_this(watch_dir)
68
+ reading.subscribe(observer)
69
+ expect(observer.listener_for(file_path).calls).to eq([:open, :accept, :accept, :eof, :delete])
70
+ expect(observer.listener_for(file_path).lines).to eq(["line1", "line2"])
71
+ end
72
+ end
73
+
58
74
  context "when watching a directory with files using striped reading" do
59
75
  let(:directory) { Stud::Temporary.directory }
60
76
  let(:watch_dir) { ::File.join(directory, "*.log") }
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.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-27 00:00:00.000000000 Z
11
+ date: 2018-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement