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!

Stay Connected: Your Guide to July Tech Talks, Office Hours, and Webinars!

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

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

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...