feat(input): Adding max files option for filecount input plugin#19096
Closed
calvinmachado20 wants to merge 3 commits into
Closed
feat(input): Adding max files option for filecount input plugin#19096calvinmachado20 wants to merge 3 commits into
calvinmachado20 wants to merge 3 commits into
Conversation
srebhan
requested changes
Jun 15, 2026
srebhan
left a comment
Member
There was a problem hiding this comment.
Thanks @calvinmachado20 for your contribution! Can we please split this PR into two, one for each option!?
Contributor
Author
|
Ack, let me do that |
2 tasks
Contributor
Author
|
Separated this PR: find new PR - #19135 for timeout addition |
Contributor
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
Member
|
@calvinmachado20 given that we do have the timeout option, wouldn't that be enough to solve #16357? |
Contributor
Author
|
@srebhan Agreed, just kept this incase we wanted to go with this approach, will cancel this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Use Case
filecount can very easily over stress a machine resources like CPU.
Expected behavior
It would be great if it will have a timeout mechanism so it wont count files until collection interval is reached.
i imagine it something like this
[[inputs.filecount]]
directories = ["D:/AidocData/Temp/IncomingDicoms"]
name = "*.dcm"
size = "0B"
timeout = "10s"
or, another possible solution is setting a maximum of files it can collect and stopping after it (also adding a field that indicates that the maximum is reached)
[[inputs.filecount]]
directories = ["D:/Temp/IncomingData"]
name = "*.txt"
size = "0B"
maximum_files = "1000000"
example:
filecount,directory=/var/cache/apt is_maximum_reached=true,count=1000000,size_bytes=7438336i,oldest_file_timestamp=1507152973123456789i,newest_file_timestamp=1507152973123456789i 1530034445000000000
Checklist
Related issues
resolves #16357
Related PR - #19135