Table of Contents

Class SplunkLoggingConfigurationExtensions

Namespace
Serilog
Assembly
Serilog.Sinks.Splunk.dll

Fluent configuration methods for Logger configuration

public static class SplunkLoggingConfigurationExtensions
Inheritance
SplunkLoggingConfigurationExtensions
Inherited Members

Methods

EventCollector(LoggerSinkConfiguration, string, string, ITextFormatter, string, LogEventLevel, int, int, int?, HttpMessageHandler, LoggingLevelSwitch)

Adds a sink that writes log events as to a Splunk instance via the HTTP Event Collector.

public static LoggerConfiguration EventCollector(this LoggerSinkConfiguration configuration, string splunkHost, string eventCollectorToken, ITextFormatter jsonFormatter, string uriPath = "services/collector/event", LogEventLevel restrictedToMinimumLevel = 0, int batchIntervalInSeconds = 2, int batchSizeLimit = 100, int? queueLimit = null, HttpMessageHandler messageHandler = null, LoggingLevelSwitch levelSwitch = null)

Parameters

configuration LoggerSinkConfiguration

The logger config

splunkHost string

The Splunk host that is configured with an Event Collector

eventCollectorToken string

The token provided to authenticate to the Splunk Event Collector

jsonFormatter ITextFormatter

The text formatter used to render log events into a JSON format for consumption by Splunk

uriPath string

Change the default endpoint of the Event Collector e.g. services/collector/event

restrictedToMinimumLevel LogEventLevel

The minimum log event level required in order to write an event to the sink.

batchIntervalInSeconds int

The interval in seconds that the queue should be instpected for batching

batchSizeLimit int

The size of the batch

queueLimit int?

Maximum number of events in the queue

messageHandler HttpMessageHandler

The handler used to send HTTP requests

levelSwitch LoggingLevelSwitch

A switch allowing the pass-through minimum level to be changed at runtime.

Returns

LoggerConfiguration

EventCollector(LoggerSinkConfiguration, string, string, CustomFields, string, string, string, string, string, LogEventLevel, IFormatProvider, bool, bool, int, int, int?, HttpMessageHandler, LoggingLevelSwitch, SubSecondPrecision)

Adds a sink that writes log events as to a Splunk instance via the HTTP Event Collector.

public static LoggerConfiguration EventCollector(this LoggerSinkConfiguration configuration, string splunkHost, string eventCollectorToken, CustomFields fields, string uriPath = "services/collector/event", string source = "", string sourceType = "", string host = "", string index = "", LogEventLevel restrictedToMinimumLevel = 0, IFormatProvider formatProvider = null, bool renderTemplate = true, bool renderMessage = true, int batchIntervalInSeconds = 2, int batchSizeLimit = 100, int? queueLimit = null, HttpMessageHandler messageHandler = null, LoggingLevelSwitch levelSwitch = null, SubSecondPrecision subSecondPrecision = SubSecondPrecision.Milliseconds)

Parameters

configuration LoggerSinkConfiguration

The logger config

splunkHost string

The Splunk host that is configured with an Event Collector

eventCollectorToken string

The token provided to authenticate to the Splunk Event Collector

fields CustomFields

Customfields that will be indexed in splunk with this event

uriPath string

Change the default endpoint of the Event Collector e.g. services/collector/event

source string

The source of the event

sourceType string

The source type of the event

host string

The host of the event

index string

The Splunk index to log to

restrictedToMinimumLevel LogEventLevel

The minimum log event level required in order to write an event to the sink.

formatProvider IFormatProvider

Supplies culture-specific formatting information, or null.

renderTemplate bool

If ture, the message template will be rendered

renderMessage bool

Include "RenderedMessage" parameter in output JSON message.

batchIntervalInSeconds int

The interval in seconds that the queue should be instpected for batching

batchSizeLimit int

The size of the batch

queueLimit int?

Maximum number of events in the queue

messageHandler HttpMessageHandler

The handler used to send HTTP requests

levelSwitch LoggingLevelSwitch

A switch allowing the pass-through minimum level to be changed at runtime.

subSecondPrecision SubSecondPrecision

Timestamp sub-second precision. Splunk props.conf setup is required.

Returns

LoggerConfiguration

EventCollector(LoggerSinkConfiguration, string, string, string, string, string, string, string, LogEventLevel, IFormatProvider, bool, bool, int, int, int?, HttpMessageHandler, LoggingLevelSwitch, SubSecondPrecision)

Adds a sink that writes log events as to a Splunk instance via the HTTP Event Collector.

public static LoggerConfiguration EventCollector(this LoggerSinkConfiguration configuration, string splunkHost, string eventCollectorToken, string uriPath = "services/collector/event", string source = "", string sourceType = "", string host = "", string index = "", LogEventLevel restrictedToMinimumLevel = 0, IFormatProvider formatProvider = null, bool renderTemplate = true, bool renderMessage = true, int batchIntervalInSeconds = 2, int batchSizeLimit = 100, int? queueLimit = null, HttpMessageHandler messageHandler = null, LoggingLevelSwitch levelSwitch = null, SubSecondPrecision subSecondPrecision = SubSecondPrecision.Milliseconds)

Parameters

configuration LoggerSinkConfiguration

The logger config

splunkHost string

The Splunk host that is configured with an Event Collector

eventCollectorToken string

The token provided to authenticate to the Splunk Event Collector

uriPath string

Change the default endpoint of the Event Collector e.g. services/collector/event

source string

The source of the event

sourceType string

The source type of the event

host string

The host of the event

index string

The Splunk index to log to

restrictedToMinimumLevel LogEventLevel

The minimum log event level required in order to write an event to the sink.

formatProvider IFormatProvider

Supplies culture-specific formatting information, or null.

renderTemplate bool

If true, the message template will be rendered

renderMessage bool

Include "RenderedMessage" parameter in output JSON message.

batchIntervalInSeconds int

The interval in seconds that the queue should be instpected for batching

batchSizeLimit int

The size of the batch

queueLimit int?

Maximum number of events in the queue

messageHandler HttpMessageHandler

The handler used to send HTTP requests

levelSwitch LoggingLevelSwitch

A switch allowing the pass-through minimum level to be changed at runtime.

subSecondPrecision SubSecondPrecision

Timestamp sub-second precision. Splunk props.conf setup is required.

Returns

LoggerConfiguration