Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(inputs.directory_monitor): Support paths for files_to_ignore and files_to_monitor #11784

Merged
merged 3 commits into from
Sep 12, 2022

Conversation

sspaink
Copy link
Contributor

@sspaink sspaink commented Sep 9, 2022

#11773 introduced the feature to traverse sub-directories, @Hipska pointed out the configuration options files_to_ignore and files_to_monitor doesn't support paths. So when two files have the same name but one is in a sub-directory there is now way to distinct one over the other.

This pull request updated the functions for matching files to the regexs that were provided to ignore and monitor to send the path instead of the name.

@telegraf-tiger telegraf-tiger bot added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Sep 9, 2022
@Hipska
Copy link
Contributor

Hipska commented Sep 10, 2022

Thanks to “fix” so fast. Didn’t test yet, will be on Monday the earliest.

I think it can be shipped, we can fix afterwards as there should be no impact for current users.

@powersj powersj merged commit ba62aca into master Sep 12, 2022
@powersj powersj deleted the dirmonpaths branch September 12, 2022 14:00
@Hipska
Copy link
Contributor

Hipska commented Sep 16, 2022

One remark: Having directories defined without trailing slash (eg directory = "/var/spool/telegraf") would it look logical to you to need to define the files_to_ignore and files_to_monitor prefixed with a slash?

dba-leshop pushed a commit to dba-leshop/telegraf that referenced this pull request Oct 30, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants