logstash-input-file 4.1.4 → 4.1.5

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: e7cb22ef0489b15ab92212c179444aefcd5be9e95fc4984c28f83de3397bf54c
4
- data.tar.gz: 7a68f15af95595390a4f44e3fd9f641522e1e8ce3feafb7b299b1e056b5b2df7
3
+ metadata.gz: 91fd970a376e7386f8b2b5ead8a5f2f62e2f1cebce0783aedd44b30913dcc4d5
4
+ data.tar.gz: 7f291854ae2eb7417d15de37d92abf2abe5524e7bd4021c2d241c0d39d177545
5
5
  SHA512:
6
- metadata.gz: fedb59ccffbf65f45f1f88dc76cd5e45d126866f75e4eb9271ef44a1e2b7922f98ff49643272cfdfa5f1ac01d445104f8a6c308f71e8255e85cc19c95809122a
7
- data.tar.gz: d10e33bf905addfc71a5ce4ce026f3fe4b7f80871b1ba087f41fc3ed7b7981289986ec61a5b4b96ef9bd37af4b26ace1219b99c723032a49a1779ee9e52010f2
6
+ metadata.gz: b1c945d44197cdab2609f351e395aaa40c45f872b912f754ce7f4485d8b00d313e693752feede403f93bf5e1c551fb90c61258821d73a72b16dbc7cbc233747a
7
+ data.tar.gz: 6d84ca4b777a648a0f7d51ec976a544fb28dc9c2370ebfd56cdfd259820d778807865751dc7e14b788f72c0c7a1fc2bdcf742e07c45fcac4c0dc0f84cef9160f
@@ -1,3 +1,7 @@
1
+ ## 4.1.5
2
+ - Fixed text anchor by changing it from hardcoded to asciidoc reference to
3
+ work in versioned plugin reference
4
+
1
5
  ## 4.1.4
2
6
  - Fixed a regression where files discovered after first discovery were not
3
7
  always read from the beginning. Applies to tail mode only.
@@ -8,6 +12,7 @@
8
12
  was possible to read into memory allocated but not filled with data resulting
9
13
  in ASCII NUL (0) bytes in the message field. Now, files are read up to the
10
14
  size as given by the remote filesystem client. Applies to tail and read modes.
15
+
11
16
  ## 4.1.3
12
17
  - Fixed `read` mode of regular files sincedb write is requested in each read loop
13
18
  iteration rather than waiting for the end-of-file to be reached. Note: for gz files,
@@ -159,12 +159,12 @@ This plugin supports the following configuration options plus the <<plugins-{typ
159
159
  [NOTE]
160
160
  Duration settings can be specified in text form e.g. "250 ms", this string will be converted into
161
161
  decimal seconds. There are quite a few supported natural and abbreviated durations,
162
- see <<string_duration,string duration>> for the details.
162
+ see <<plugins-{type}s-{plugin}-string_duration,string_duration>> for the details.
163
163
 
164
164
  [cols="<,<,<",options="header",]
165
165
  |=======================================================================
166
166
  |Setting |Input type|Required
167
- | <<plugins-{type}s-{plugin}-close_older>> |<<number,number>> or <<string_duration,string duration>>|No
167
+ | <<plugins-{type}s-{plugin}-close_older>> |<<number,number>> or <<plugins-{type}s-{plugin}-string_duration,string_duration>>|No
168
168
  | <<plugins-{type}s-{plugin}-delimiter>> |<<string,string>>|No
169
169
  | <<plugins-{type}s-{plugin}-discover_interval>> |<<number,number>>|No
170
170
  | <<plugins-{type}s-{plugin}-exclude>> |<<array,array>>|No
@@ -174,15 +174,15 @@ see <<string_duration,string duration>> for the details.
174
174
  | <<plugins-{type}s-{plugin}-file_completed_log_path>> |<<string,string>>|No
175
175
  | <<plugins-{type}s-{plugin}-file_sort_by>> |<<string,string>>, one of `["last_modified", "path"]`|No
176
176
  | <<plugins-{type}s-{plugin}-file_sort_direction>> |<<string,string>>, one of `["asc", "desc"]`|No
177
- | <<plugins-{type}s-{plugin}-ignore_older>> |<<number,number>> or <<string_duration,string duration>>|No
177
+ | <<plugins-{type}s-{plugin}-ignore_older>> |<<number,number>> or <<plugins-{type}s-{plugin}-string_duration,string_duration>>|No
178
178
  | <<plugins-{type}s-{plugin}-max_open_files>> |<<number,number>>|No
179
179
  | <<plugins-{type}s-{plugin}-mode>> |<<string,string>>, one of `["tail", "read"]`|No
180
180
  | <<plugins-{type}s-{plugin}-path>> |<<array,array>>|Yes
181
- | <<plugins-{type}s-{plugin}-sincedb_clean_after>> |<<number,number>> or <<string_duration,string duration>>|No
181
+ | <<plugins-{type}s-{plugin}-sincedb_clean_after>> |<<number,number>> or <<plugins-{type}s-{plugin}-string_duration,string_duration>>|No
182
182
  | <<plugins-{type}s-{plugin}-sincedb_path>> |<<string,string>>|No
183
- | <<plugins-{type}s-{plugin}-sincedb_write_interval>> |<<number,number>> or <<string_duration,string duration>>|No
183
+ | <<plugins-{type}s-{plugin}-sincedb_write_interval>> |<<number,number>> or <<plugins-{type}s-{plugin}-string_duration,string_duration>>|No
184
184
  | <<plugins-{type}s-{plugin}-start_position>> |<<string,string>>, one of `["beginning", "end"]`|No
185
- | <<plugins-{type}s-{plugin}-stat_interval>> |<<number,number>> or <<string_duration,string duration>>|No
185
+ | <<plugins-{type}s-{plugin}-stat_interval>> |<<number,number>> or <<plugins-{type}s-{plugin}-string_duration,string_duration>>|No
186
186
  |=======================================================================
187
187
 
188
188
  Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
@@ -193,7 +193,7 @@ input plugins.
193
193
  [id="plugins-{type}s-{plugin}-close_older"]
194
194
  ===== `close_older`
195
195
 
196
- * Value type is <<number,number>> or <<string_duration,string duration>>
196
+ * Value type is <<number,number>> or <<plugins-{type}s-{plugin}-string_duration,string_duration>>
197
197
  * Default value is `"1 hour"`
198
198
 
199
199
  The file input closes any files that were last read the specified
@@ -311,7 +311,7 @@ If you use special naming conventions for the file full paths then perhaps
311
311
  [id="plugins-{type}s-{plugin}-ignore_older"]
312
312
  ===== `ignore_older`
313
313
 
314
- * Value type is <<number,number>> or <<string_duration,string duration>>
314
+ * Value type is <<number,number>> or <<plugins-{type}s-{plugin}-string_duration,string_duration>>
315
315
  * There is no default value for this setting.
316
316
 
317
317
  When the file input discovers a file that was last modified
@@ -371,7 +371,7 @@ on the {logstash-ref}/configuration-file-structure.html#array[Logstash configura
371
371
  [id="plugins-{type}s-{plugin}-sincedb_clean_after"]
372
372
  ===== `sincedb_clean_after`
373
373
 
374
- * Value type is <<number,number>> or <<string_duration,string duration>>
374
+ * Value type is <<number,number>> or <<plugins-{type}s-{plugin}-string_duration,string_duration>>
375
375
  * The default value for this setting is "2 weeks".
376
376
  * If a number is specified then it is interpreted as *days* and can be decimal e.g. 0.5 is 12 hours.
377
377
 
@@ -395,7 +395,7 @@ NOTE: it must be a file path and not a directory path
395
395
  [id="plugins-{type}s-{plugin}-sincedb_write_interval"]
396
396
  ===== `sincedb_write_interval`
397
397
 
398
- * Value type is <<number,number>> or <<string_duration,string duration>>
398
+ * Value type is <<number,number>> or <<plugins-{type}s-{plugin}-string_duration,string_duration>>
399
399
  * Default value is `"15 seconds"`
400
400
 
401
401
  How often (in seconds) to write a since database with the current position of
@@ -421,7 +421,7 @@ position recorded in the sincedb file will be used.
421
421
  [id="plugins-{type}s-{plugin}-stat_interval"]
422
422
  ===== `stat_interval`
423
423
 
424
- * Value type is <<number,number>> or <<string_duration,string duration>>
424
+ * Value type is <<number,number>> or <<plugins-{type}s-{plugin}-string_duration,string_duration>>
425
425
  * Default value is `"1 second"`
426
426
 
427
427
  How often (in seconds) we stat files to see if they have been modified.
@@ -438,9 +438,8 @@ the pipeline is congested. So the overall loop time is a combination of the
438
438
  [id="plugins-{type}s-{plugin}-common-options"]
439
439
  include::{include_path}/{type}.asciidoc[]
440
440
 
441
- :default_codec!:
442
441
 
443
- [id="string_duration"]
442
+ [id="plugins-{type}s-{plugin}-string_duration"]
444
443
  // Move this to the includes when we make string durations available generally.
445
444
  ==== String Durations
446
445
 
@@ -474,3 +473,4 @@ Supported values: `us` `usec` `usecs`, e.g. "600 us", "800 usec", "900 usecs"
474
473
  [NOTE]
475
474
  `micro` `micros` and `microseconds` are not supported
476
475
 
476
+ :default_codec!:
@@ -30,6 +30,7 @@ module FileWatch module ReadMode module Handlers
30
30
  def controlled_read(watched_file, loop_control)
31
31
  logger.trace("reading...", "iterations" => loop_control.count, "amount" => loop_control.size, "filename" => watched_file.filename)
32
32
  loop_control.count.times do
33
+ break if quit?
33
34
  begin
34
35
  result = watched_file.read_extract_lines(loop_control.size) # expect BufferExtractResult
35
36
  logger.info(result.warning, result.additional) unless result.warning.empty?
@@ -6,12 +6,17 @@ module FileWatch module TailMode module Handlers
6
6
  include LogStash::Util::Loggable
7
7
  attr_reader :sincedb_collection
8
8
 
9
- def initialize(sincedb_collection, observer, settings)
9
+ def initialize(processor, sincedb_collection, observer, settings)
10
10
  @settings = settings
11
+ @processor = processor
11
12
  @sincedb_collection = sincedb_collection
12
13
  @observer = observer
13
14
  end
14
15
 
16
+ def quit?
17
+ @processor.watch.quit?
18
+ end
19
+
15
20
  def handle(watched_file)
16
21
  logger.trace("handling: #{watched_file.filename}")
17
22
  unless watched_file.has_listener?
@@ -41,7 +46,9 @@ module FileWatch module TailMode module Handlers
41
46
  # user also has the option to specify a low `stat_interval` and a very high `discover_interval`to respond
42
47
  # quicker to changing files and not allowing too much content to build up before reading it.
43
48
  loop_control.count.times do
49
+ break if quit?
44
50
  begin
51
+ logger.debug("read_to_eof: get chunk")
45
52
  result = watched_file.read_extract_lines(loop_control.size) # expect BufferExtractResult
46
53
  logger.trace(result.warning, result.additional) unless result.warning.empty?
47
54
  changed = true
@@ -62,6 +69,7 @@ module FileWatch module TailMode module Handlers
62
69
  break
63
70
  end
64
71
  end
72
+ logger.debug("read_to_eof: exit due to quit") if quit?
65
73
  sincedb_collection.request_disk_flush if changed
66
74
  end
67
75
 
@@ -5,6 +5,7 @@ module FileWatch module TailMode module Handlers
5
5
  def handle_specifically(watched_file)
6
6
  watched_file.file_seek(watched_file.bytes_read)
7
7
  loop do
8
+ break if quit?
8
9
  loop_control = watched_file.loop_control_adjusted_for_stat_size
9
10
  controlled_read(watched_file, loop_control)
10
11
  break unless loop_control.more
@@ -6,6 +6,7 @@ module FileWatch module TailMode module Handlers
6
6
  add_or_update_sincedb_collection(watched_file)
7
7
  watched_file.file_seek(watched_file.bytes_read)
8
8
  loop do
9
+ break if quit?
9
10
  loop_control = watched_file.loop_control_adjusted_for_stat_size
10
11
  controlled_read(watched_file, loop_control)
11
12
  break unless loop_control.more
@@ -35,13 +35,13 @@ module FileWatch module TailMode
35
35
 
36
36
  def initialize_handlers(sincedb_collection, observer)
37
37
  @sincedb_collection = sincedb_collection
38
- @create_initial = Handlers::CreateInitial.new(sincedb_collection, observer, @settings)
39
- @create = Handlers::Create.new(sincedb_collection, observer, @settings)
40
- @grow = Handlers::Grow.new(sincedb_collection, observer, @settings)
41
- @shrink = Handlers::Shrink.new(sincedb_collection, observer, @settings)
42
- @delete = Handlers::Delete.new(sincedb_collection, observer, @settings)
43
- @timeout = Handlers::Timeout.new(sincedb_collection, observer, @settings)
44
- @unignore = Handlers::Unignore.new(sincedb_collection, observer, @settings)
38
+ @create_initial = Handlers::CreateInitial.new(self, sincedb_collection, observer, @settings)
39
+ @create = Handlers::Create.new(self, sincedb_collection, observer, @settings)
40
+ @grow = Handlers::Grow.new(self, sincedb_collection, observer, @settings)
41
+ @shrink = Handlers::Shrink.new(self, sincedb_collection, observer, @settings)
42
+ @delete = Handlers::Delete.new(self, sincedb_collection, observer, @settings)
43
+ @timeout = Handlers::Timeout.new(self, sincedb_collection, observer, @settings)
44
+ @unignore = Handlers::Unignore.new(self, sincedb_collection, observer, @settings)
45
45
  end
46
46
 
47
47
  def create(watched_file)
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.4'
4
+ s.version = '4.1.5'
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"
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
4
+ version: 4.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-13 00:00:00.000000000 Z
11
+ date: 2018-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement