I'm testing uploading a file using the Splunk Python SDK and receiving the following error :
Traceback (most recent call last):
File "testConnection.py", line 50, in
myindex.upload("/opt/splunkforwarder/bin/scripts/test");
File "/home/hafahmed/splunk-sdk-python-1.6.6/splunklib/client.py", line 2106, in upload
self.service.post(path, name=filename, **kwargs)
File "/home/hafahmed/splunk-sdk-python-1.6.6/splunklib/binding.py", line 289, in wrapper
return request_fun(self, *args, **kwargs)
File "/home/hafahmed/splunk-sdk-python-1.6.6/splunklib/binding.py", line 71, in new_f
val = f(*args, **kwargs)
File "/home/hafahmed/splunk-sdk-python-1.6.6/splunklib/binding.py", line 752, in post
response = self.http.post(path, all_headers, **query)
File "/home/hafahmed/splunk-sdk-python-1.6.6/splunklib/binding.py", line 1224, in post
return self.request(url, message)
File "/home/hafahmed/splunk-sdk-python-1.6.6/splunklib/binding.py", line 1244, in request
raise HTTPError(response)
splunklib.binding.HTTPError: HTTP 400 Bad Request -- unable to open file: path='/opt/splunkforwarder/bin/scripts/test' error='No such file or directory'
Code snippet:
myindex = service.indexes["testing"]
myindex.upload("/opt/splunkforwarder/bin/scripts/test");
The file exists and has the correct permissions, Any hints?
... View more