New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot escaping backslash, spaces, special chars in exec input on Windows #2230
Comments
Can you provide exactly what you tried and the error you received in each case? |
I think i know the problem, i have similar situation, this is my example:
I need sent for psscript smb network path with slashs, but now it is not possible with telegraf |
what if you don't put quotes around could you try |
@dmitrysdm Not bad, i didn't think about replace slash, thanks :) |
This is how i make it works after too many tries:
I replaced back slash \ with forward slash / in the script path. Here is my script that return the status of msmq :
|
We should provide a method for specifying a list of args to the script, instead of depending on go-shellquote to parse them. |
Hey @danielnelson @sparrc I'm trying to run the following powershell script: function Get-ServiceStatus($service) { I'm using telegraf exec as follows: For some reason I receive the following error in telegraf log: Can you please help me to figure out what am I doing wrong ? |
Looks like there is an error in the powershell script, but I don't know powershell so I can't help. Make sure it exits with status code 0. |
@danielnelson have the same problem, tray to move the filte "servicecheck.ps1" to a path with out spaces (wihtespace) [[inputs.exec]] |
Has anyone been able to get this to work with glob?
However it's giving me the following error, even after trying multiple
FWIW - Running the scripts individually like this seems to work just fine:
Is it related to the other cases of Windows and multiple instances not working? Any ideas would be appreciated. |
@amitkumar912 I think this issue will need to be fixed before you will be able to get the globs to work in Windows. It isn't related to those other issues. I recommend listing the scripts one at a time, as I'd be somewhat uneasy with the idea of executing based on a glob personally. |
try this : [[inputs.exec]] |
For anyone still having issues, there is some additional advice posted on #6339. |
Any progress? It's been three years, so I was just hoping that ... |
i got this working.
|
As mentioned above there is a way to make this work. Closing the issue. |
I just setup my telegraf.conf who run a powershell script with a path as an argument.
Problem is : My argument can be a network path, and it seems like there are no way to use backslash with the exec input.
commands = ['powershell ./parse_send_csv.ps1 "\blabla\a"']
Using
\\
results to having 2 backslash : Not workingUsing only one
\
results to no backslash : Not workingUsing single or double quote or both : Not working
I even tried to escape with character (escaping character in golang) with no success.
The text was updated successfully, but these errors were encountered: