Wildcard a directory in inputs.exec

With inputs.exec, I can have a command that looks like this (taken from the default telegraf.conf):

"/tmp/collect_*.sh"

Can I wildcard a directory in the path? I have a small suite of scripts to gather metrics. They don’t all share the same configuration so I’d like to put them into their own directories like so:

/path/to/my/scripts/poller_*/get_stats.py

This would be easier than adding a line for every new metric. It’d also mean that I don’t need to reorganize everything (especially configuration reading) as each individual metric is self contained to it’s own directory.

Thank you

1 Like

I don’t believe that works, but if you try and it does, report back. You could set your wildcard call as contents of a separate script and call that:

/tmp/do-collect.sh

bash /tmp/collect_*.sh