Getting Data In

How to set the Metadata field using the Splunk .Net logging library HttpEventCollectorSender?

sfortier99
Engager

I'm using the Splunk .Net logging library on Github to interface to the Splunk HTTP Event Collector.

My question is, how to set the Metadata field using the following example:

        var ecSender = new HttpEventCollectorSender(new Uri("https://localhost:8088"),
            "AAAAAAAAAAAAAAAAAAAAAAA",
            how to set this Metadata field - I want it to be source="AppA",
            HttpEventCollectorSender.SendMode.Sequential,
            0,
            0,
            0,
            middleware.Plugin
        );

Thanks.

0 Karma
1 Solution

somesoni2
Revered Legend

Before invoking this HttpEventCollectorSender constructor, create an object of type HttpEventCollectorEventInfo and set it's Metadata property. Details of HttpEventCollectorEventInfo class here.

https://github.com/splunk/splunk-library-dotnetlogging/blob/3ca85b1e51082d8c0dfe9815c1006e252656efae...

The Metadata is a nested class within HttpEventCollectorEventInfo class with following attributes

            public string Index { get; private set; }
            public string Source { get; private set; }
            public string SourceType { get; private set; }
            public string Host { get; private set; }

View solution in original post

somesoni2
Revered Legend

Before invoking this HttpEventCollectorSender constructor, create an object of type HttpEventCollectorEventInfo and set it's Metadata property. Details of HttpEventCollectorEventInfo class here.

https://github.com/splunk/splunk-library-dotnetlogging/blob/3ca85b1e51082d8c0dfe9815c1006e252656efae...

The Metadata is a nested class within HttpEventCollectorEventInfo class with following attributes

            public string Index { get; private set; }
            public string Source { get; private set; }
            public string SourceType { get; private set; }
            public string Host { get; private set; }

maqsoodbhatti
Explorer

MetaData property are read-only says it when i try to initialize, Could you share code please?

0 Karma
Get Updates on the Splunk Community!

AI for AppInspect

We’re excited to announce two new updates to AppInspect designed to save you time and make the app approval ...

App Platform's 2025 Year in Review: A Year of Innovation, Growth, and Community

As we step into 2026, it’s the perfect moment to reflect on what an extraordinary year 2025 was for the Splunk ...

Operationalizing Entity Risk Score with Enterprise Security 8.3+

Overview Enterprise Security 8.3 introduces a powerful new feature called “Entity Risk Scoring” (ERS) for ...