Splunk Dev

Why am I getting error "The remote server returned an error: (400) Bad Request." trying to send data via C# SDK to the Splunk Cloud Trial Sandbox?

malkiz_walkme
Explorer

Hi,
I want to send data from the C# SDK to my Splunk Cloud Trial Sandbox.
This is what I have so far:

            var service = new Service("localhost", 8089, "https");

            // Log in
            service.Login("admin", "changeme");

            var args = new ReceiverSubmitArgs
            {
                Source = "splunk-sdk-tests",
                SourceType = "splunk-sdk-test-event",
            };

            var receiver = new Receiver(service);

            // Submit to default index
            receiver.Submit("default", args, "Hello World.");

But I'm getting an error:

"The remote server returned an error: (400) Bad Request."

Why does this happen?

I realize there is also another option of sending data to TCP input.
How can I configure it in the sandbox?

Tags (5)
0 Karma

yannK
Splunk Employee
Splunk Employee
0 Karma
Get Updates on the Splunk Community!

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...