Class CompactSplunkJsonFormatter
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)
Construct a CompactSplunkJsonFormatter.
public CompactSplunkJsonFormatter(bool renderTemplate = false, string source = null, string sourceType = null, string host = null, string index = null, SubSecondPrecision subSecondPrecision = SubSecondPrecision.Milliseconds)
Parameters
renderTemplate
boolIf true, the template used will be rendered and written to the output as a property named MessageTemplate
source
stringThe source of the event
sourceType
stringThe source type of the event
host
stringThe host of the event
index
stringThe Splunk index to log to
subSecondPrecision
SubSecondPrecisionTimestamp sub-second precision. Splunk props.conf setup is required.
Methods
Format(LogEvent, TextWriter)
public void Format(LogEvent logEvent, TextWriter output)
Parameters
logEvent
LogEventoutput
TextWriter