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!

New Year, New Changes for Splunk Certifications

As we embrace a new year, we’re making a small but important update to the Splunk Certification ...

[Puzzles] Solve, Learn, Repeat: Unmerging HTML Tables

[Puzzles] Solve, Learn, Repeat: Unmerging HTML TablesFor a previous puzzle, I needed some sample data, and ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...