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!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

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