can we use powershell script in telegraf?
[[inputs.exec]] commands = ["D:\Tealeaf\System\canisterstats.ps1"] timeout = "30s" data_format = "influx" name_suffix = "_expPlusCan"
am getting below error : C:\Program Files\Telegraf>telegraf -config telegraf.conf -test Error parsing telegraf.conf, toml: line 131: parse error
this is line 131 -- commands = ["D:\Tealeaf\System\canisterstats.ps1"]
You need to escape your backslash in your commands path. Use double backslash instead \\
commands = ["D:\\Tealeaf\\System\\canisterstats.ps1"]
Thanks puckpuck.. Still error.. changed from ps1 to bat :-(
[[inputs.exec]] commands = ["D:\Tealeaf\System\canstat.bat"] timeout = "30s" data_format = "json" name_suffix = "_expPlusCan"
2016/11/12 04:39:53 Errors encountered: [exec: exec: "D:TealeafSystemcanstat.bat ": file does not exist for command 'D:\Tealeaf\System\canstat.bat']
commands = ["D:/\Tealeaf/\System/\canstat.bat"] --- this one working !!!
Thanks for showing me a way ;-)
I am having the same issue: In my case PS C:\Program Files\telegraf> .\telegraf.exe -config telegraf.conf -test 2017/03/23 17:48:50 E! Error parsing telegraf.conf, toml: line 179: parse error
And this is line 179: commands = ["C:/\process.bat"] I've tried commands = ["C:\process.bat"] as well and same issue.
@mananpatel Please take a look at this issue: #2230
@danielnelson Thanks. That worked lake a charm.
Try like this, i has the same issue and use '/' instead of '\' or '\\', it works.
[[inputs.exec]] commands = ["D:/Tealeaf/System/canisterstats.ps1"] timeout = "30s" data_format = "influx" name_suffix = "_expPlusCan"