filestat_exporter icon indicating copy to clipboard operation
filestat_exporter copied to clipboard

Command Substitution

Open jonli662 opened this issue 11 months ago • 3 comments

Nice exporter! Is it possible to have shell expansions (command substitution) in the pattern of the config file? I have tried but not got it to work. If it isn't possible today, could you implement it?

For example to catch a file with todays date:

/tmp/*_`date +%Y%m%d`.log

jonli662 avatar Mar 05 '24 13:03 jonli662

Any thoughts on this yet?

jonli662 avatar Apr 03 '24 07:04 jonli662

I guess it is possible to have some templating but it won't be an open shell execution. It would be a huge security risk.

michael-doubez avatar Apr 04 '24 06:04 michael-doubez

Sounds great! Hope you can implement it, I'm afraid I don't have skills to contribute on this.

jonli662 avatar Apr 11 '24 06:04 jonli662

@jonli662 The expression /tmp/*_{{now.Local.Format "20060102"}}.log should do the job with latest version

michael-doubez avatar Jun 24 '24 22:06 michael-doubez