logstash-input-file 3.1.2 → 4.0.0

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: 517e94fddd4ca73a733b01e023edf1675030d6f8
4
- data.tar.gz: a325e49d3bf6597fe0ade161ff4942c9dd4145cf
3
+ metadata.gz: 00f5e922badbdd1b31300eb066d5d9b3917ed967
4
+ data.tar.gz: 06bd5932092a2b1989f7478c469d587d4d240928
5
5
  SHA512:
6
- metadata.gz: 83584264653eb07b7a7600744c1e45565f68f4c10f4bb53c7736fedc1801386d73cfbcdb77070058aefd8361dc2a875a6b81e91f7fdb46455fe0ae5745be6556
7
- data.tar.gz: 31ad48d0a47159dfcf8d5df2706688c89dd30618c1209d8dae744d180c65936665b931b4af8ce3a9a50f8e232853143d2862c1deb32c654bda7358db43d80cba
6
+ metadata.gz: e7b898485e484698a4774dadd163402ba0492d8bcda39559fa5b4be14ff8d9ededc7fbe2f7831de16092770b9ce688131d0e22be4c0568c8ed354ce62e82e676
7
+ data.tar.gz: bd425a072f2c1b262d522db2a36f53ec2ac88e47f6f406f69bc2c3dec8370bc8f7d70562065a87b108e1ebb09aae2d4f26765a09aa46e168c4a2feeede64c516
data/CHANGELOG.md CHANGED
@@ -1,21 +1,36 @@
1
+ ## 4.0.0
2
+ - Breaking: `ignore_older` settings is disabled by default. Previously if the file was older than
3
+ 24 hours (the default for ignore_older), it would be ignored. This confused new users a lot, specially
4
+ when they were reading new files with Logstash (with `start_position => beginning`). This setting also
5
+ makes it consistent with Filebeat.
6
+
1
7
  ## 3.1.2
2
8
  - Adjust a few log call levels
9
+
3
10
  ## 3.1.1
4
11
  - Add host to @metadata
12
+
5
13
  ## 3.1.0
6
- - Use native `--path.data` for Logstash 5.0 for sincedb files.
14
+ - Breaking: Use native `--path.data` for Logstash 5.0 for sincedb files.
15
+
7
16
  ## 3.0.3
8
17
  - Relax constraint on logstash-core-plugin-api to >= 1.60 <= 2.99
18
+
9
19
  ## 3.0.2
10
20
  - relax constrains of `logstash-devutils` see https://github.com/elastic/logstash-devutils/issues/48
21
+
11
22
  ## 3.0.1
12
23
  - Republish all the gems under jruby.
24
+
13
25
  ## 3.0.0
14
26
  - Update the plugin to the version 2.0 of the plugin api, this change is required for Logstash 5.0 compatibility. See https://github.com/elastic/logstash/issues/5141
27
+
15
28
  # 2.2.5
16
29
  - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
30
+
17
31
  # 2.2.3
18
32
  - New dependency requirements for logstash-core for the 5.0 release
33
+
19
34
  ## 2.2.2
20
35
  - Fix for: Filewatch library complains if HOME or SINCEDB_PATH variables are unset.
21
36
  - [Issue #101](https://github.com/logstash-plugins/logstash-input-file/issues/101)
@@ -146,8 +146,9 @@ class LogStash::Inputs::File < LogStash::Inputs::Base
146
146
  # When the file input discovers a file that was last modified
147
147
  # before the specified timespan in seconds, the file is ignored.
148
148
  # After it's discovery, if an ignored file is modified it is no
149
- # longer ignored and any new data is read. The default is 24 hours.
150
- config :ignore_older, :validate => :number, :default => 24 * 60 * 60
149
+ # longer ignored and any new data is read. By default, this option is
150
+ # disabled. Note this unit is in seconds.
151
+ config :ignore_older, :validate => :number
151
152
 
152
153
  # The file input closes any files that were last read the specified
153
154
  # timespan in seconds ago.
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-file'
4
- s.version = '3.1.2'
4
+ s.version = '4.0.0'
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/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -129,6 +129,41 @@ describe LogStash::Inputs::File do
129
129
  insist { events[1].get("[@metadata][host]") } == "#{Socket.gethostname.force_encoding(Encoding::UTF_8)}"
130
130
  end
131
131
 
132
+ it "should read old files" do
133
+ tmpfile_path = Stud::Temporary.pathname
134
+
135
+ conf = <<-CONFIG
136
+ input {
137
+ file {
138
+ type => "blah"
139
+ path => "#{tmpfile_path}"
140
+ start_position => "beginning"
141
+ codec => "json"
142
+ }
143
+ }
144
+ CONFIG
145
+
146
+ File.open(tmpfile_path, "w") do |fd|
147
+ fd.puts('{"path": "my_path", "host": "my_host"}')
148
+ fd.puts('{"my_field": "my_val"}')
149
+ fd.fsync
150
+ end
151
+ # arbitrary old file (2 days)
152
+ FileInput.make_file_older(tmpfile_path, 48 * 60 * 60)
153
+
154
+ events = input(conf) do |pipeline, queue|
155
+ 2.times.collect { queue.pop }
156
+ end
157
+
158
+ insist { events[0].get("path") } == "my_path"
159
+ insist { events[0].get("host") } == "my_host"
160
+ insist { events[0].get("[@metadata][host]") } == "#{Socket.gethostname.force_encoding(Encoding::UTF_8)}"
161
+
162
+ insist { events[1].get("path") } == "#{tmpfile_path}"
163
+ insist { events[1].get("host") } == "#{Socket.gethostname.force_encoding(Encoding::UTF_8)}"
164
+ insist { events[1].get("[@metadata][host]") } == "#{Socket.gethostname.force_encoding(Encoding::UTF_8)}"
165
+ end
166
+
132
167
  context "when sincedb_path is an existing directory" do
133
168
  let(:tmpfile_path) { Stud::Temporary.pathname }
134
169
  let(:sincedb_path) { Stud::Temporary.directory }
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: 3.1.2
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-15 00:00:00.000000000 Z
11
+ date: 2016-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement