Splunk Dev

Powershell scripting

MikeBertelsen
Communicator

Just starting to look at this but any help here is appreciated.
A coworker asked me the following:
Mike, I was trying to work on a PowerShell script I wanted to be able to query Splunk. I pulled open one of my old queries that is being utilized now as automated process to start testing and it appears even when I run that known working script I get I believe connection errors.

Invoke-HTTPPost : Exception calling "GetRequestStream" with "0" argument(s): "The operation has timed out"
At C:\Users\marks\Documents\WindowsPowerShell\Modules\Splunk\Splunk-Core\Splunk-Core.psm1:591 char:62
+ "POST" { $xml = Invoke-HTTPPost ...
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-HTTPPost

Get-SplunkAuthToken : [Get-SplunkAuthToken] :: No value returned from Server [servernamehere]
At C:\Users\marks\Documents\WindowsPowerShell\Modules\Splunk\Splunk-Authentication\Splunk-Authentication.psm1:127 char:21
+ $AuthTokenObject = Get-SplunkAuthToken @GetSplunkAuthTokenParams
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-SplunkAuthToken

Invoke-HTTPPost : Exception calling "GetRequestStream" with "0" argument(s): "The operation has timed out"
At C:\Users\marks\Documents\WindowsPowerShell\Modules\Splunk\Splunk-Core\Splunk-Core.psm1:579 char:62
+ "POST" { $xml = Invoke-HTTPPost ...
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-HTTPPost

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...