I'm writing a custom command that is supposed to do some actions on Splunk through its REST interface so I wanted to use the SDK.
However, I'm having problems authenticating with the session token. Here's the setup:
import splunklib.client as client
import splunk.Intersplunk as si
settings = dict()
records = si.readResults(settings = settings, has_header = True)
sKey = settings['sessionKey']
service = client.connect(token=sKey)
a = service.apps["search"]
st = a.state()
And I don't get anything back.
If I change the client.connect call to use hardcoded credentials it works without any problems.
In Splunk I'm logged in as admin.
Any idea why I can't pass tokens like this to the Service class?