Splunk Dev

Using Splunk SDK for C#, getting errors regarding WebException and connection closure.

harrisflourentz
New Member

Hi,
I am new to Splunk (and new to Software Dev for that matter). My company uses splunkSDK (C#) nugget package to log data about user activity in one of our apps. I understand that this is an older version and now Splunk.Client should be used instead.

So I am trying to learn how to use Splunk SDK in order to access statistics about the log data fed into Splunk and display them in the app. That is why I am keen on running the examples first with a separate profile to avoid messing up the real data.

In the meantime, I have downloaded and installed the free Splunk Enterprise platform locally and went through the search examples.

I have downloaded the SDK for C#, compiled the solution, updated the dummy credentials to match my Splunk Enterprise trial profile, and tried to run any of the examples. I get the following error:

WebException: The underlying connection was closed: The connection was closed unexpectedly. with http
WebException: The request was aborted: Could not create SSL/TLS secure channel. with https

Note: The following curl command does successfully return an XML response, which would imply that authentication is achieved for the local Splunk Enterprise host that I have installed on my machine. (Obviously credentials are updated when the following was run)

curl -k https://localhost:8089/services/auth/login--data-urlencodeusername=admin--data-urlencodepassword=pas...

Please let me know if I am not specific enough so I can update the question. Thank you.

Labels (1)
0 Karma

jkat54
SplunkTrust
SplunkTrust

Unfortunately the C# sdk has been broken since the new auth mechanisms were put in place circa 7.1+

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...