I am going through https://github.com/influxdata/telegraf/tree/master/plugins/outputs/file
But there is no option to rotate the log file.
This is causing huge log files to be created which have to be deleted manually.
Once deleted manually, telegraf does not recreate that file and only option is to restart telegraf.
I do not want to rotate the log file with a cron job because telegraf may be in the middle of doing something with the log file and as per our use-case, we need to have last 10 minutes of telegraf output with metrics being sent by telegraf every minute.
Seems like someone started in this direction, but never completed it. https://github.com/influxdata/telegraf/issues/1550
Please update telegraf to newer version
1.12.x
, they support rotation on both output file plugin and agent log