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
splunkHost
stringThe host of the Splunk instance with the Event collector configured
eventCollectorToken
stringThe token to use when authenticating with the event collector
formatProvider
IFormatProviderThe format provider used when rendering the message
renderTemplate
boolWhether to render the message template
renderMessage
boolInclude "RenderedMessage" parameter in output JSON message.
subSecondPrecision
SubSecondPrecisionTimestamp 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
splunkHost
stringThe host of the Splunk instance with the Event collector configured
eventCollectorToken
stringThe token to use when authenticating with the event collector
uriPath
stringChange the default endpoint of the Event Collector e.g. services/collector/event
jsonFormatter
ITextFormatterThe text formatter used to render log events into a JSON format for consumption by Splunk
messageHandler
HttpMessageHandlerThe 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
splunkHost
stringThe host of the Splunk instance with the Event collector configured
eventCollectorToken
stringThe token to use when authenticating with the event collector
uriPath
stringChange the default endpoint of the Event Collector e.g. services/collector/event
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
fields
CustomFieldsAdd extra CustomExtraFields for Splunk to index
formatProvider
IFormatProviderThe format provider used when rendering the message
renderTemplate
boolWhether to render the message template
renderMessage
boolInclude "RenderedMessage" parameter in output JSON message.
messageHandler
HttpMessageHandlerThe handler used to send HTTP requests
subSecondPrecision
SubSecondPrecisionTimestamp 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
splunkHost
stringThe host of the Splunk instance with the Event collector configured
eventCollectorToken
stringThe token to use when authenticating with the event collector
uriPath
stringChange the default endpoint of the Event Collector e.g. services/collector/event
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
formatProvider
IFormatProviderThe format provider used when rendering the message
renderTemplate
boolWhether to render the message template
renderMessage
boolInclude "RenderedMessage" parameter in output JSON message.
messageHandler
HttpMessageHandlerThe handler used to send HTTP requests
subSecondPrecision
SubSecondPrecisionTimestamp sub-second precision. Splunk props.conf setup is required.
Methods
EmitBatchAsync(IReadOnlyCollection<LogEvent>)
public virtual Task EmitBatchAsync(IReadOnlyCollection<LogEvent> batch)
Parameters
batch
IReadOnlyCollection<LogEvent>
Returns
OnEmptyBatchAsync()
public virtual Task OnEmptyBatchAsync()