Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(inputs.directory_monitor): Traverse sub-directories #11773

Merged
merged 9 commits into from
Sep 7, 2022
Merged

Conversation

sspaink
Copy link
Contributor

@sspaink sspaink commented Sep 6, 2022

resolves #11718
resolves https://github.com/influxdata/feature-requests/issues/441

This resolves a feature request to have the input plugin directory_monitor also process sub-directories. This does change the default behavior, I suppose this could be a breaking change? Not sure if this would be a problem for users? I could add a configuration flag but the best idea I have for this is a boolean flag called "recurse=true/false", so if you think a config option should be required be happy to hear suggestions.

edit: This feature has been put behind the boolean configuration option "recursive" to make this behavior optional

@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 6, 2022
@sspaink sspaink added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Sep 6, 2022
@Hipska Hipska removed the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Sep 7, 2022
Copy link
Contributor

@Hipska Hipska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a user configurable setting to not change behaviour for current users?
For example, me and possibly other users drop the finished files into a "done" directory in the same main directory. With this new feature, that would mean these files will be read again and again after updating and not changing any configurations..

Edit: Your suggested "recurse=true/false" sounds good to me. (I would have uses "recursive", not sure what is better)

PS: This feature would be useful for me as well!

@Hipska Hipska added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Sep 7, 2022
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Sep 7, 2022

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for looking into it @sspaink!

@srebhan srebhan merged commit f238df2 into master Sep 7, 2022
@srebhan srebhan deleted the subdirmonitor branch September 7, 2022 19:08
@Hipska
Copy link
Contributor

Hipska commented Sep 8, 2022

@sspaink one question, do the options files_to_monitor and files_to_ignore now work with paths? It doesn't seem so, and now it's not possible to include/exclude certain files..

@sspaink
Copy link
Contributor Author

sspaink commented Sep 8, 2022

Your right those options don't work with paths, but just the names of the files. So it should work for a file in a sub-directory if you just provide its name.

@Hipska
Copy link
Contributor

Hipska commented Sep 9, 2022

Yeah, but the names are the same, so only based on name it isn't possible to distinguish

@sspaink
Copy link
Contributor Author

sspaink commented Sep 9, 2022

@Hipska Good point, I've created a pull request to support paths in the ignore and monitor config options: #11784 could you take a look and maybe try it out to make sure it works for you?

dba-leshop pushed a commit to dba-leshop/telegraf that referenced this pull request Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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 ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tail Input Plugin should remove file handle after a certain time
3 participants