Table of Contents

Class CompactSplunkJsonFormatter

Namespace
Serilog.Sinks.Splunk
Assembly
Serilog.Sinks.Splunk.dll

Renders log events into a Compact JSON format for consumption by Splunk.

public class CompactSplunkJsonFormatter : ITextFormatter
Inheritance
CompactSplunkJsonFormatter
Implements
ITextFormatter
Inherited Members

Constructors

CompactSplunkJsonFormatter(bool, string, string, string, string, SubSecondPrecision)

public CompactSplunkJsonFormatter(bool renderTemplate = false, string source = null, string sourceType = null, string host = null, string index = null, SubSecondPrecision subSecondPrecision = SubSecondPrecision.Milliseconds)

Parameters

renderTemplate bool

If true, the template used will be rendered and written to the output as a property named MessageTemplate

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

subSecondPrecision SubSecondPrecision

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

Methods

Format(LogEvent, TextWriter)

public void Format(LogEvent logEvent, TextWriter output)

Parameters

logEvent LogEvent
output TextWriter