Splunk Cloud Platform

Run Search with API and PowerShell

Splunkie
Explorer

Hello All,

I need help with a PowerShell script to that runs a search on Splunk Cloud via the REST API and retrieve results to be stored in a .csv file. I have put together the script below but I am not having any luck. I keep getting unable to connect to the remote server error. Can you please have a look at my script to help me spot anything I am missing.

Thanks.

Labels (1)
Tags (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Does your Splunk Cloud stack have REST API enabled (it's off by default)?  If not, open a support case.

Is the IP address of the server running the script on your stack's IP Allow List?  If not, get a Splunk admin to add it.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

App Platform's 2025 Year in Review: A Year of Innovation, Growth, and Community

As we step into 2026, it’s the perfect moment to reflect on what an extraordinary year 2025 was for the Splunk ...

Operationalizing Entity Risk Score with Enterprise Security 8.3+

Overview Enterprise Security 8.3 introduces a powerful new feature called “Entity Risk Scoring” (ERS) for ...

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...