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!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...