@@ -146,10 +146,15 @@ will not get picked up.
146
146
147
147
This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
148
148
149
+ [NOTE]
150
+ Duration settings can be specified in text form e.g. "250 ms", this string will be converted into
151
+ decimal seconds. There are quite a few supported natural and abbreviated durations,
152
+ see <<string_duration,string duration>> for the details.
153
+
149
154
[cols="<,<,<",options="header",]
150
155
|=======================================================================
151
156
|Setting |Input type|Required
152
- | <<plugins-{type}s-{plugin}-close_older>> |<<number,number>>|No
157
+ | <<plugins-{type}s-{plugin}-close_older>> |<<number,number>> or <<string_duration,string duration>> |No
153
158
| <<plugins-{type}s-{plugin}-delimiter>> |<<string,string>>|No
154
159
| <<plugins-{type}s-{plugin}-discover_interval>> |<<number,number>>|No
155
160
| <<plugins-{type}s-{plugin}-exclude>> |<<array,array>>|No
@@ -159,15 +164,15 @@ This plugin supports the following configuration options plus the <<plugins-{typ
159
164
| <<plugins-{type}s-{plugin}-file_completed_log_path>> |<<string,string>>|No
160
165
| <<plugins-{type}s-{plugin}-file_sort_by>> |<<string,string>>, one of `["last_modified", "path"]`|No
161
166
| <<plugins-{type}s-{plugin}-file_sort_direction>> |<<string,string>>, one of `["asc", "desc"]`|No
162
- | <<plugins-{type}s-{plugin}-ignore_older>> |<<number,number>>|No
167
+ | <<plugins-{type}s-{plugin}-ignore_older>> |<<number,number>> or <<string_duration,string duration>> |No
163
168
| <<plugins-{type}s-{plugin}-max_open_files>> |<<number,number>>|No
164
169
| <<plugins-{type}s-{plugin}-mode>> |<<string,string>>, one of `["tail", "read"]`|No
165
170
| <<plugins-{type}s-{plugin}-path>> |<<array,array>>|Yes
166
- | <<plugins-{type}s-{plugin}-sincedb_clean_after>> |<<number,number>>|No
171
+ | <<plugins-{type}s-{plugin}-sincedb_clean_after>> |<<number,number>> or <<string_duration,string duration>> |No
167
172
| <<plugins-{type}s-{plugin}-sincedb_path>> |<<string,string>>|No
168
- | <<plugins-{type}s-{plugin}-sincedb_write_interval>> |<<number,number>>|No
173
+ | <<plugins-{type}s-{plugin}-sincedb_write_interval>> |<<number,number>> or <<string_duration,string duration>> |No
169
174
| <<plugins-{type}s-{plugin}-start_position>> |<<string,string>>, one of `["beginning", "end"]`|No
170
- | <<plugins-{type}s-{plugin}-stat_interval>> |<<number,number>>|No
175
+ | <<plugins-{type}s-{plugin}-stat_interval>> |<<number,number>> or <<string_duration,string duration>> |No
171
176
|=======================================================================
172
177
173
178
Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
@@ -178,18 +183,18 @@ input plugins.
178
183
[id="plugins-{type}s-{plugin}-close_older"]
179
184
===== `close_older`
180
185
181
- * Value type is <<number,number>>
182
- * Default value is `3600 `
186
+ * Value type is <<number,number>> or <<string_duration,string duration>>
187
+ * Default value is `"1 hour" `
183
188
184
189
The file input closes any files that were last read the specified
185
- timespan in seconds ago.
190
+ duration ( seconds if a number is specified) ago.
186
191
This has different implications depending on if a file is being tailed or
187
192
read. If tailing, and there is a large time gap in incoming data the file
188
193
can be closed (allowing other files to be opened) but will be queued for
189
194
reopening when new data is detected. If reading, the file will be closed
190
195
after closed_older seconds from when the last bytes were read.
191
196
This setting is retained for backward compatibility if you upgrade the
192
- plugin to 5.0 .0+, are reading not tailing and do not switch to using Read mode.
197
+ plugin to 4.1 .0+, are reading not tailing and do not switch to using Read mode.
193
198
194
199
[id="plugins-{type}s-{plugin}-delimiter"]
195
200
===== `delimiter`
@@ -206,8 +211,10 @@ this setting is not used, instead the standard Windows or Unix line endings are
206
211
* Value type is <<number,number>>
207
212
* Default value is `15`
208
213
209
- How often (in seconds) we expand the filename patterns in the
210
- `path` option to discover new files to watch.
214
+ How often we expand the filename patterns in the `path` option to discover new files to watch.
215
+ This value is a multiple to `stat_interval`, e.g. if `stat_interval` is "500 ms" then new files
216
+ files could be discovered every 15 X 500 milliseconds - 7.5 seconds.
217
+ In practice, this will be the best case because the time taken to read new content needs to be factored in.
211
218
212
219
[id="plugins-{type}s-{plugin}-exclude"]
213
220
===== `exclude`
@@ -294,11 +301,11 @@ If you use special naming conventions for the file full paths then perhaps
294
301
[id="plugins-{type}s-{plugin}-ignore_older"]
295
302
===== `ignore_older`
296
303
297
- * Value type is <<number,number>>
304
+ * Value type is <<number,number>> or <<string_duration,string duration>>
298
305
* There is no default value for this setting.
299
306
300
307
When the file input discovers a file that was last modified
301
- before the specified timespan in seconds, the file is ignored.
308
+ before the specified duration ( seconds if a number is specified) , the file is ignored.
302
309
After it's discovery, if an ignored file is modified it is no
303
310
longer ignored and any new data is read. By default, this option is
304
311
disabled. Note this unit is in seconds.
@@ -354,9 +361,9 @@ on the {logstash-ref}/configuration-file-structure.html#array[Logstash configura
354
361
[id="plugins-{type}s-{plugin}-sincedb_clean_after"]
355
362
===== `sincedb_clean_after`
356
363
357
- * Value type is <<number,number>>
358
- * The default value for this setting is 14 .
359
- * This unit is in *days* and can be decimal e.g. 0.5 is 12 hours.
364
+ * Value type is <<number,number>> or <<string_duration,string duration>>
365
+ * The default value for this setting is "2 weeks" .
366
+ * If a number is specified then it is interpreted as *days* and can be decimal e.g. 0.5 is 12 hours.
360
367
361
368
The sincedb record now has a last active timestamp associated with it.
362
369
If no changes are detected in a tracked file in the last N days its sincedb
@@ -378,8 +385,8 @@ NOTE: it must be a file path and not a directory path
378
385
[id="plugins-{type}s-{plugin}-sincedb_write_interval"]
379
386
===== `sincedb_write_interval`
380
387
381
- * Value type is <<number,number>>
382
- * Default value is `15 `
388
+ * Value type is <<number,number>> or <<string_duration,string duration>>
389
+ * Default value is `"15 seconds" `
383
390
384
391
How often (in seconds) to write a since database with the current position of
385
392
monitored log files.
@@ -404,15 +411,56 @@ position recorded in the sincedb file will be used.
404
411
[id="plugins-{type}s-{plugin}-stat_interval"]
405
412
===== `stat_interval`
406
413
407
- * Value type is <<number,number>>
408
- * Default value is `1 `
414
+ * Value type is <<number,number>> or <<string_duration,string duration>>
415
+ * Default value is `"1 second" `
409
416
410
417
How often (in seconds) we stat files to see if they have been modified.
411
418
Increasing this interval will decrease the number of system calls we make,
412
419
but increase the time to detect new log lines.
420
+ [NOTE]
421
+ Discovering new files and checking whether they have grown/or shrunk occurs in a loop.
422
+ This loop will sleep for `stat_interval` seconds before looping again. However, if files
423
+ have grown, the new content is read and lines are enqueued.
424
+ Reading and enqueuing across all grown files can take time, especially if
425
+ the pipeline is congested. So the overall loop time is a combination of the
426
+ `stat_interval` and the file read time.
413
427
414
428
[id="plugins-{type}s-{plugin}-common-options"]
415
429
include::{include_path}/{type}.asciidoc[]
416
430
417
431
:default_codec!:
418
432
433
+ [id="string_duration"]
434
+ // Move this to the includes when we make string durations available generally.
435
+ ==== String Durations
436
+
437
+ Format is `number` `string` and the space between these is optional.
438
+ So "45s" and "45 s" are both valid.
439
+ [TIP]
440
+ Use the most suitable duration, for example, "3 days" rather than "72 hours".
441
+
442
+ ===== Weeks
443
+ Supported values: `w` `week` `weeks`, e.g. "2 w", "1 week", "4 weeks".
444
+
445
+ ===== Days
446
+ Supported values: `d` `day` `days`, e.g. "2 d", "1 day", "2.5 days".
447
+
448
+ ===== Hours
449
+ Supported values: `h` `hour` `hours`, e.g. "4 h", "1 hour", "0.5 hours".
450
+
451
+ ===== Minutes
452
+ Supported values: `m` `min` `minute` `minutes`, e.g. "45 m", "35 min", "1 minute", "6 minutes".
453
+
454
+ ===== Seconds
455
+ Supported values: `s` `sec` `second` `seconds`, e.g. "45 s", "15 sec", "1 second", "2.5 seconds".
456
+
457
+ ===== Milliseconds
458
+ Supported values: `ms` `msec` `msecs`, e.g. "500 ms", "750 msec", "50 msecs
459
+ [NOTE]
460
+ `milli` `millis` and `milliseconds` are not supported
461
+
462
+ ===== Microseconds
463
+ Supported values: `us` `usec` `usecs`, e.g. "600 us", "800 usec", "900 usecs"
464
+ [NOTE]
465
+ `micro` `micros` and `microseconds` are not supported
466
+
0 commit comments