Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions plugins/in_tail/tail.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,14 @@ static struct flb_config_map config_map[] = {
FLB_CONFIG_MAP_INT, "progress_check_interval_nsec", "0",
0, FLB_TRUE, offsetof(struct flb_tail_config, progress_check_interval_nsec),
},
{
FLB_CONFIG_MAP_TIME, "stat.read_interval_sec", "0s",
0, FLB_TRUE, offsetof(struct flb_tail_config, read_interval_sec),
},
{
FLB_CONFIG_MAP_INT, "stat.read_interval_nsec", "250000000",
0, FLB_TRUE, offsetof(struct flb_tail_config, read_interval_nsec),
},
{
FLB_CONFIG_MAP_TIME, "rotate_wait", FLB_TAIL_ROTATE_WAIT,
0, FLB_TRUE, offsetof(struct flb_tail_config, rotate_wait),
Expand Down
3 changes: 3 additions & 0 deletions plugins/in_tail/tail_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ struct flb_tail_config {
int progress_check_interval; /* watcher interval */
int progress_check_interval_nsec; /* watcher interval */

int read_interval_sec; /* seconds to re-read file, only used by fs_stat */
int read_interval_nsec; /* nanoseconds to re-read file, only used by fs_stat */

#ifdef FLB_HAVE_INOTIFY
int inotify_watcher; /* enable/disable inotify monitor */
#endif
Expand Down
6 changes: 4 additions & 2 deletions plugins/in_tail/tail_fs_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,11 @@ int flb_tail_fs_stat_init(struct flb_input_instance *in,

flb_plg_debug(ctx->ins, "flb_tail_fs_stat_init() initializing stat tail input");

/* Set a manual timer to collect events every 0.250 seconds */
/* Set a manual timer to collect events managed by 'read_interval' property */
ret = flb_input_set_collector_time(in, tail_fs_event,
0, 250000000, config);
ctx->read_interval_sec,
ctx->read_interval_nsec,
config);
if (ret < 0) {
return -1;
}
Expand Down