Skip to content

feat(input): Adding max files option for filecount input plugin#19096

Closed
calvinmachado20 wants to merge 3 commits into
influxdata:masterfrom
calvinmachado20:feature/adding_timeout_and_max_file_count
Closed

feat(input): Adding max files option for filecount input plugin#19096
calvinmachado20 wants to merge 3 commits into
influxdata:masterfrom
calvinmachado20:feature/adding_timeout_and_max_file_count

Conversation

@calvinmachado20

@calvinmachado20 calvinmachado20 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

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

@telegraf-tiger telegraf-tiger Bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Jun 14, 2026

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @calvinmachado20 for your contribution! Can we please split this PR into two, one for each option!?

@srebhan srebhan self-assigned this Jun 15, 2026
@calvinmachado20

Copy link
Copy Markdown
Contributor Author

Ack, let me do that

@calvinmachado20

Copy link
Copy Markdown
Contributor Author

Separated this PR: find new PR - #19135 for timeout addition

@telegraf-tiger

Copy link
Copy Markdown
Contributor

@calvinmachado20 calvinmachado20 changed the title feat(input): Adding timeout and max files options for filecount input plugin feat(input): Adding max files options for filecount input plugin Jun 20, 2026
@calvinmachado20 calvinmachado20 changed the title feat(input): Adding max files options for filecount input plugin feat(input): Adding max files option for filecount input plugin Jun 20, 2026
@srebhan

srebhan commented Jun 25, 2026

Copy link
Copy Markdown
Member

@calvinmachado20 given that we do have the timeout option, wouldn't that be enough to solve #16357?

@calvinmachado20

Copy link
Copy Markdown
Contributor Author

@srebhan Agreed, just kept this incase we wanted to go with this approach, will cancel this PR

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

filecount input plugin timeout

2 participants