Getting Data In

Splunk API Time out - Powershell script

pmccomb001
New Member

I've made a script in PowerShell which utilizes the REST API input that I have. This script is for downloading extremely large amounts of data from Splunk.

The problem that I am having is that Invoke-WebRequest is timing out and I cannot get the query to complete. The query stays connected for ~5minutes and times out.

0 Karma

pmccomb001
New Member

Thanks for the response but the solution is not working. Folks had the same results in this thread:
https://stackoverflow.com/questions/34136088/invoke-webrequest-set-time-out

0 Karma

pmccomb001
New Member

Thanks for a response but this is still not working. Folks have the same results in this thread:
https://stackoverflow.com/questions/34136088/invoke-webrequest-set-time-out

Any other thoughts?

0 Karma

efavreau
Motivator

@pmccomb001 Set this in your powershell profile, or run beforehand:

[System.Net.ServicePointManager]::MaxServicePointIdleTime = 5000000

Then when you run Invoke-WebRequest make sure you have the TimeoutSec parameter set to zero:

Invoke-WebRequest therestofyourcommand -TimeoutSec 0
###

If this reply helps you, an upvote would be appreciated.
0 Karma

pmccomb001
New Member

Thanks for the response but this is still not working. Folks had the same issue in this thread:
https://stackoverflow.com/questions/34136088/invoke-webrequest-set-time-out

0 Karma

pmccomb001
New Member

Any other thoughts/ideas?

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...