logstash-input-file 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5319e9eb1c38b91734226b4eb97bbc7ee84e3eec
4
- data.tar.gz: 47903b7f1ba56c91baa61acd29af2f1cb7961d21
3
+ metadata.gz: c56f2ba7106f61178bb34833bef500378352d39e
4
+ data.tar.gz: 8234370a6b5d313ff1057d5a6ea638cba656a83a
5
5
  SHA512:
6
- metadata.gz: e03a060ea74cfbf4ae2cfc18bfe6517b6dd83dd68c2f5a36674136ca00fa30375c4c2a55a7d77acc7e26437fba9680bb40ce73f17064417c514f44cf93896639
7
- data.tar.gz: 4c7bcf126d12d903ef633ebe5042e31dd9d16d27091232a6bc5222a0cfa6268a6dbb0eb4dd17bab271019d75c2682bd8d659a6a931770f04828900f7c64c2d6c
6
+ metadata.gz: d64a4bd6c7610a1678244a016c7c97cceacf460f71b39a975d4a9954aabd33593bd8280a0833b3a5be57f94e0db1b23d4d2372a82ec611132a75f2aa4d415a7f
7
+ data.tar.gz: 4e86dc4b6b5c3c8fd70cf02e85e91ca02623199177fbeb29fd9be40821181a83f996d46076291e78a501e7c1ad0f7882471c474147c736368b588977129ce8f3
data/CHANGELOG.md CHANGED
@@ -0,0 +1,3 @@
1
+ ## 1.0.1
2
+ - Force dependency on filewatch >= 0.6.5 that fixes a sincedb bug
3
+ - Better documentation and error handling regarding the "sincedb_path" parameter
@@ -46,9 +46,10 @@ class LogStash::Inputs::File < LogStash::Inputs::Base
46
46
  # How often (in seconds) we expand globs to discover new files to watch.
47
47
  config :discover_interval, :validate => :number, :default => 15
48
48
 
49
- # Where to write the sincedb database (keeps track of the current
50
- # position of monitored log files). The default will write
51
- # sincedb files to some path matching `$HOME/.sincedb*`
49
+ # Path of the sincedb database file (keeps track of the current
50
+ # position of monitored log files) that will be written to disk.
51
+ # The default will write sincedb files to some path matching `$HOME/.sincedb*`
52
+ # NOTE: it must be a file path and not a directory path
52
53
  config :sincedb_path, :validate => :string
53
54
 
54
55
  # How often (in seconds) to write a since database with the current position of
@@ -120,6 +121,10 @@ class LogStash::Inputs::File < LogStash::Inputs::Base
120
121
  :sincedb_path => @sincedb_path, :path => @path)
121
122
  end
122
123
 
124
+ if File.directory?(@sincedb_path)
125
+ raise ArgumentError.new("The \"sincedb_path\" argument must point to a file, received a directory: \"#{@sincedb_path}\"")
126
+ end
127
+
123
128
  @tail_config[:sincedb_path] = @sincedb_path
124
129
 
125
130
  if @start_position == "beginning"
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-file'
4
- s.version = '1.0.0'
4
+ s.version = '1.0.1'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Stream 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/plugin install gemname. This gem is not a stand-alone program"
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
 
25
25
  s.add_runtime_dependency 'logstash-codec-plain'
26
26
  s.add_runtime_dependency 'addressable'
27
- s.add_runtime_dependency 'filewatch', ['>= 0.6.4', '~> 0.6']
27
+ s.add_runtime_dependency 'filewatch', ['>= 0.6.5', '~> 0.6']
28
28
 
29
29
  s.add_development_dependency 'stud', ['~> 0.0.19']
30
30
  s.add_development_dependency 'logstash-devutils'
@@ -3,6 +3,7 @@
3
3
  require "logstash/devutils/rspec/spec_helper"
4
4
  require "tempfile"
5
5
  require "stud/temporary"
6
+ require "logstash/inputs/file"
6
7
 
7
8
  describe "inputs/file" do
8
9
 
@@ -165,4 +166,18 @@ describe "inputs/file" do
165
166
  insist { events[1]["path"] } == "#{tmpfile_path}"
166
167
  insist { events[1]["host"] } == "#{Socket.gethostname.force_encoding(Encoding::UTF_8)}"
167
168
  end
169
+
170
+ context "when sincedb_path is an existing directory" do
171
+ let(:tmpfile_path) { Stud::Temporary.pathname }
172
+ let(:sincedb_path) { Stud::Temporary.directory }
173
+ subject { LogStash::Inputs::File.new("path" => tmpfile_path, "sincedb_path" => sincedb_path) }
174
+
175
+ after :each do
176
+ FileUtils.rm_rf(sincedb_path)
177
+ end
178
+
179
+ it "should raise exception" do
180
+ expect { subject.register }.to raise_error(ArgumentError)
181
+ end
182
+ end
168
183
  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: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-24 00:00:00.000000000 Z
11
+ date: 2015-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core
@@ -64,7 +64,7 @@ dependencies:
64
64
  requirements:
65
65
  - - '>='
66
66
  - !ruby/object:Gem::Version
67
- version: 0.6.4
67
+ version: 0.6.5
68
68
  - - ~>
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0.6'
@@ -72,7 +72,7 @@ dependencies:
72
72
  requirements:
73
73
  - - '>='
74
74
  - !ruby/object:Gem::Version
75
- version: 0.6.4
75
+ version: 0.6.5
76
76
  - - ~>
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0.6'
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  version: '0'
160
160
  requirements: []
161
161
  rubyforge_project:
162
- rubygems_version: 2.2.2
162
+ rubygems_version: 2.1.9
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: Stream events from files.