Getting Data In

Help with source code for logging in Splunk Cloud

venkatesanengin
New Member

I am trying to post logs onto Splunk cloud from .NET application.
Below is the source code, please let me know if am missing something:

public bool SendDataToSplunk()
        {
            var middleware = new HttpEventCollectorResendMiddleware(100);
            var ecSender = new HttpEventCollectorSender(new Uri("https://prd-p-pqh9ws5tppvf.cloud.splunk.com"),  //http port as set in global setting
                "c5731f11-dd2b-4261-ac68-7292d1bcb6a4",  // token
                null,
                HttpEventCollectorSender.SendMode.Sequential,
                0,
                0,
                0,
                middleware.Plugin
            );
            ecSender.OnError += o => Console.WriteLine(o.Message);
            ecSender.Send(Guid.NewGuid().ToString(), "INFO", null, new { Foo = "Vihaan" });
            ecSender.FlushSync();

            return true;
        }
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

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, ...