Class EventCollectorSink
A sink to log to the Event Collector available in Splunk 6.3
public class EventCollectorSink : IBatchedLogEventSink
- Inheritance
-
EventCollectorSink
- Implements
-
IBatchedLogEventSink
- Inherited Members
Constructors
EventCollectorSink(string, string, IFormatProvider, bool, bool, SubSecondPrecision)
Creates a new instance of the sink
public EventCollectorSink(string splunkHost, string eventCollectorToken, IFormatProvider formatProvider = null, bool renderTemplate = true, bool renderMessage = true, SubSecondPrecision subSecondPrecision = SubSecondPrecision.Milliseconds)
Parameters
splunkHoststringThe host of the Splunk instance with the Event collector configured
eventCollectorTokenstringThe token to use when authenticating with the event collector
formatProviderIFormatProviderThe format provider used when rendering the message
renderTemplateboolWhether to render the message template
renderMessageboolInclude "RenderedMessage" parameter in output JSON message.
subSecondPrecisionSubSecondPrecisionTimestamp sub-second precision. Splunk props.conf setup is required.
EventCollectorSink(string, string, string, ITextFormatter, HttpMessageHandler)
Creates a new instance of the sink
public EventCollectorSink(string splunkHost, string eventCollectorToken, string uriPath, ITextFormatter jsonFormatter, HttpMessageHandler messageHandler = null)
Parameters
splunkHoststringThe host of the Splunk instance with the Event collector configured
eventCollectorTokenstringThe token to use when authenticating with the event collector
uriPathstringChange the default endpoint of the Event Collector e.g. services/collector/event
jsonFormatterITextFormatterThe text formatter used to render log events into a JSON format for consumption by Splunk
messageHandlerHttpMessageHandlerThe handler used to send HTTP requests
EventCollectorSink(string, string, string, string, string, string, string, CustomFields, IFormatProvider, bool, bool, HttpMessageHandler, SubSecondPrecision)
Creates a new instance of the sink with Customfields
public EventCollectorSink(string splunkHost, string eventCollectorToken, string uriPath, string source, string sourceType, string host, string index, CustomFields fields, IFormatProvider formatProvider = null, bool renderTemplate = true, bool renderMessage = true, HttpMessageHandler messageHandler = null, SubSecondPrecision subSecondPrecision = SubSecondPrecision.Milliseconds)
Parameters
splunkHoststringThe host of the Splunk instance with the Event collector configured
eventCollectorTokenstringThe token to use when authenticating with the event collector
uriPathstringChange the default endpoint of the Event Collector e.g. services/collector/event
sourcestringThe source of the event
sourceTypestringThe source type of the event
hoststringThe host of the event
indexstringThe Splunk index to log to
fieldsCustomFieldsAdd extra CustomExtraFields for Splunk to index
formatProviderIFormatProviderThe format provider used when rendering the message
renderTemplateboolWhether to render the message template
renderMessageboolInclude "RenderedMessage" parameter in output JSON message.
messageHandlerHttpMessageHandlerThe handler used to send HTTP requests
subSecondPrecisionSubSecondPrecisionTimestamp sub-second precision. Splunk props.conf setup is required.
EventCollectorSink(string, string, string, string, string, string, string, IFormatProvider, bool, bool, HttpMessageHandler, SubSecondPrecision)
Creates a new instance of the sink
public EventCollectorSink(string splunkHost, string eventCollectorToken, string uriPath, string source, string sourceType, string host, string index, IFormatProvider formatProvider = null, bool renderTemplate = true, bool renderMessage = true, HttpMessageHandler messageHandler = null, SubSecondPrecision subSecondPrecision = SubSecondPrecision.Milliseconds)
Parameters
splunkHoststringThe host of the Splunk instance with the Event collector configured
eventCollectorTokenstringThe token to use when authenticating with the event collector
uriPathstringChange the default endpoint of the Event Collector e.g. services/collector/event
sourcestringThe source of the event
sourceTypestringThe source type of the event
hoststringThe host of the event
indexstringThe Splunk index to log to
formatProviderIFormatProviderThe format provider used when rendering the message
renderTemplateboolWhether to render the message template
renderMessageboolInclude "RenderedMessage" parameter in output JSON message.
messageHandlerHttpMessageHandlerThe handler used to send HTTP requests
subSecondPrecisionSubSecondPrecisionTimestamp sub-second precision. Splunk props.conf setup is required.
Methods
EmitBatchAsync(IReadOnlyCollection<LogEvent>)
public virtual Task EmitBatchAsync(IReadOnlyCollection<LogEvent> batch)
Parameters
batchIReadOnlyCollection<LogEvent>
Returns
OnEmptyBatchAsync()
public virtual Task OnEmptyBatchAsync()