I am trying to get data from a third party API
so I get splunk to run this very basic script.
IP=$(curl -s 'http://api.openweathermap.org/data/2.5/weather?q=london,uk&appid=xxxxxxxxxxxxxxxxxxxxxxx')
if I run the script in shell it works perfect.
if it is run by splunk $ip is empty
I know splunk can execute the script because I replace $(curl.... by "test" and splunk collects it OK.
splunk seams to be executing script as root because if chance my script to
splunk returns root.
it is not just this url i tried different ones, it works in shell but it is always empty when run by splunk.
Can you please try below command in your script, added ().
IP=($(curl -s 'http://api.openweathermap.org/data/2.5/weather?q=london,uk≈pid=xxxxxxxxxxxxxxxxxxxxxxx'))