-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Is your feature request related to a problem? Please describe.
This is about how tail polugin handle permission error generated by glob.
In currrent implementation if regex(Path option) matches directory which do not have enough permission, entire tail plugin will fail.
Ideal behaviour is showing warning for directory with permission issue and keep running.
Describe the solution you'd like
Create skip_permission_errors option and change path extraction(glob) logic like below
(https://github.com/fluent/fluent-bit/blob/master/plugins/in_tail/tail_scan_glob.c#L207)
/* Scan the given path */
ret = do_glob(path, GLOB_TILDE | GLOB_ERR, NULL, &globbuf);
/*Scan if aborted && skip_permission_errors is true*/
if (ret == GLOB_ABORTED && ctx->skip_permission_errors) {
globfree(&globbuf);
flb_plg_warn(ctx->ins, "read error, check permissions: %s", path);
ret = do_glob(path, GLOB_TILDE, NULL, &globbuf);
}
Describe alternatives you've considered
Additional context
Stopping entire input plugin is not ideal behaviour.
Planning to set default for skip_permission_errors false so that no behaviour change for existing configuration.
We have local version with this change and happy to contribute.