Hi,
I am developing an output plugin.
I need to access the configuration from the output. So, I am doing the following:
c := config.NewConfig()
err := c.LoadConfig(“/etc/telegraf/telegraf.conf”)
if err != nil {
log.Printf(“I! error reading configfile”)
}
err = c.LoadDirectory(“/etc/telegraf/conf.d/”)
if err != nil {
log.Printf(“I! error reading configdir”)
}
but the err := c.LoadConfig(“/etc/telegraf/telegraf.conf”) fails. It does not return any err. But the agent enters in loop and tries to load the config again and again.
Any help will highly appreciated.
Regards,