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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...