Getting Data In

Using Python SDK to run search against data model -- permissions issues

himynamesdave
Contributor

All I'm running a query using python SDK against a data model stored in a custom app. I get the response:

FATAL: Error in 'TsidxStats': Could not find datamodel: MYDATAMODEL

I know this error is caused because the DM is set to App level permissions. It appears the search via the SDK is being dispatched from a default location (maybe search app?).

Can someone let me know if it's possible to explicitly set the dispatch app when running requests through the SDK?

micahkemp
Champion

You need to include your app path in the URL. In curl it might look like:

curl -k -u admin https://localhost:8089/servicesNS/<your user>/<your app>/search/jobs/ -d search="| tstats count FROM datamodel=<your datamodel>"

Where <your app> is the app path as shown in the URL bar of your browser while using that app.

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...