Splunk Search

Why am I receiving the following exception "Read where response was expected" while trying to connect to Splunk?

Ralex1
New Member

Hi all,
I have the following code that tries to connect:

try
{
      var service = new Service(new Uri($"https://ec2-34-242-197-8.eu-west-1.compute.amazonaws.com:8089"));                          
      Login(service). Wait();
}
catch (Exception e)
{
      Console.Write($"Exception thrown while connecting: {e.Message}");
}

The Login command yields the exception: Read html where the response was expected
What am I doing wrong here?
Thanks,
Alex

0 Karma

amitm05
Builder

Can you try to check in the logs of your splunk machine. I believe the splunkd.log on your splunk instance will be able to give you more clear message of what is happening and further help in troubleshooting.

0 Karma

Ralex1
New Member

Thanks much!! definitely going to try to locate this file and look into it.
Many thanks !

0 Karma

DalJeanis
SplunkTrust
SplunkTrust

Is there really a space after the period in your code ?

   Login(service). Wait();

What is the function of the $ before the double-quotes? I don't find any examples that have that.

 new Uri($"https://ec2-34-242-197-8.eu-west-1.compute.amazonaws.com:8089")
         ^
0 Karma

Ralex1
New Member

Hi, thanks for your comments -
Re space- no space in the code itself, just a typo in the question.
Re $ sign - no functionality currently, can be removed. I've used it previously to test with several different ports, and then I had the $ useful as in the following example:

new Uri($"https://ec2-34-242-197-8.eu-west-1.compute.amazonaws.com:{nPort}")
Thanks,
Alex

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...