Skip to content

A NLog target for Splunk Http Event Collector (HEC) Sender

License

Notifications You must be signed in to change notification settings

Haddox19/NLog.Targets.Splunk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLog.Targets.Splunk

NLog.Targets.Splunk is a Splunk HTTP Event Collector target for NLog

NuGet version

Getting started

First you will need to have a running install of Splunk Enterprise and setup a HTTP Event Collector

Then configure the SplunkHttpEventCollector with ServerUrl and Token:

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <extensions>
    <add assembly="NLog.Targets.Splunk" />
  </extensions>
  <targets async="true">
    <target name="Splunk"
            xsi:type="SplunkHttpEventCollector"
            serverUrl="https://splunk-server:8088"
            token="token-guid"
            channel="channel-guid"
            retriesOnError="0"
            batchSizeBytes="0"
            batchSizeCount="0"
            includeEventProperties="true"
            includeMdlc="false"
            includePositionalParameters="false"
	    MaxConnectionsPerServer="10"
	    IgnoreSslErrors="false"
	    source="my_source"
      	    sourcetype="my_source_type"
	    index="my_index">
		<contextproperty name="host" layout="${machinename}" />
		<contextproperty name="threadid" layout="${threadid}" />
		<contextproperty name="logger" layout="${logger}" />
	</target>    
  </targets>
  <rules>
    <logger name="*" minlevel="Debug" writeTo="Splunk" />
  </rules>
</nlog>

Feedback / Issues

Feel free to tweet @alanbarber for questions or comments on the code.
You can also submit a GitHub issue here.

License

https://github.com/alanbarber/NLog.Targets.Splunk/blob/master/LICENSE

About

A NLog target for Splunk Http Event Collector (HEC) Sender

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.3%
  • Other 0.7%