jwang
1
Dear Sir/Madam,
My simple config file has:
[[inputs.logparser]]
file(s) to tail:
files = ["/data/mnt2/haproxy-2018-04-17:12.log"]
As file name is based on current hour, I wish to make it like (BASH here):
[[inputs.logparser]]
file(s) to tail:
files = ["/data/mnt2/haproxy-$(date +%Y-%m-%d:%H).log"]
Is this possible please?
Thanks a lot in advance
daniel
2
This is not possible to do directly with Telegraf, but maybe you can setup a cron job that updates a symlink every day?
#!/bin/sh
ln -s /data/mnt2/haproxy-$(date +%Y-%m-%d:%H).log /data/mnt2/haproxy-latest.new
mv /data/mnt2/haproxy-latest.new /data/mnt2/haproxy-latest
jwang
3
thanks a lot for your help indeed