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.

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Maximizing the Value of Splunk ES 8.x

Splunk Enterprise Security (ES) continues to be a leader in the Gartner Magic Quadrant, reflecting its pivotal ...

Operationalizing TDIR: Building a More Resilient, Scalable SOC

Optimizing SOC workflows with a unified, risk-based approach to Threat Detection, Investigation, and Response ...