One of the first things I would suggest is to use ignoreOlderThan in inputs.conf in order to keep splunkd from iterating through files with a modification time that has fallen behind a certain time window :
ignoreOlderThan = <time window>
* Causes the monitored input to stop checking files for updates if their modtime has passed this threshold.
This improves the speed of file tracking operations when monitoring directory hierarchies with large numbers of historical files (for example, when active log files are colocated with old files that are no longer being written to).
* As a result, do not select a cutoff that could ever occur for a file you wish to index.
Take downtime into account!
Suggested value: 14d , which means 2 weeks
* A file whose modtime falls outside this time window when seen for the first time will not be indexed at all.
* Value must be: <number><unit> (e.g., 7d is one week). Valid units are d (days), m (minutes), and s (seconds).
* Default: disabled.
Beyond that, you would need to use external means to further restrict the number of files that are exposed to splunkd so that it doesn't have to create and maintain a large number of objects in memory. Note that using a whitelist or blacklist in inputs.conf to exclude some files from indexing still exposes them to splunkd for evaluation, which contributes to its resource consumption.
If your directory structure and log file distribution allows it, try to define one file monitor stanza per directory that contains logs to follow (up to 50 or so is reasonable) and use recursive = false in inputs.conf to scope the tailing processor to those directories only.
This advice is of course irrelevant if you actually have live logs you want to index in all 699 directories.
UPDATE : ** After discussing this with one of our developers, it turns out that ignoreOlderThan doesn't prevent us from creating an in-memory object for every file the tailing processor sees on splunkd startup, it just sets some aside never to be queried from disk ever again. As a result, ignoreOlderThan will have a positive effect on splunkd CPU usage but most likely **not on memory usage.
... View more