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
renderTemplateboolIf true, the template used will be rendered and written to the output as a property named MessageTemplate
sourcestringThe source of the event
sourceTypestringThe source type of the event
hoststringThe host of the event
indexstringThe Splunk index to log to
subSecondPrecisionSubSecondPrecisionTimestamp sub-second precision. Splunk props.conf setup is required.
Methods
Format(LogEvent, TextWriter)
public void Format(LogEvent logEvent, TextWriter output)
Parameters
logEventLogEventoutputTextWriter