Counting Files in Folders

Is there a way to capture the number of files that exist in a folder where the file has not been modified for a period of time?

I have a requirement to capture this information, and then build alarms of the back of this data.

I have googled but yet to find a solution, so any links to the solution would be appreciated.

The solution must not consume those files into elastic.

If you can get the correct command and parse it you can do it with logstash exec input plugin. Now you just need to find which command works for your OS. For instance on Linux you can use ls | wc -l to get the file count of a folder.

I don't know of a way to do it without Logtash.

Apologies as very new to the whole ELK stack.

So you have to create a process that writes the answer to a file, and then consume that file into elastic, for that to the read the contents and process accordingly?
If that is correct then when the file is overwritten with the new value then does elastic know that the value has changed, or do you have to create a new file each time?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.