Skip to content

smashraid/NLog.Splunk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NLog.Splunk

Splunk target to send logs in splunk


Getting Started

Use the GUI or the following command in the Package Manager Console

Install-Package NLog.Splunk

Then add it to your solution

ConfigurationItemFactory.Default.Targets.RegisterDefinition("Splunk", typeof(SplunkTarget));

Configuration

For async configuration you can use with BufferingWrapper

<target xsi:type="BufferingWrapper" 
name="f" 
bufferSize="100" 
slidingTimeout="true" 
flushTimeout="10000" >
    <target xsi:type="Splunk"               
    layout="${longdate} | ${uppercase:${level}} | ${message} | ${exception}"
    host="{url-to-splunk}"
    username="{your-username}"
    password="{your-password}"
    index="{your-index}"
    source="{your-source}"
    sourceType="{your-source-type}"
    />
</target>

Otherwise you can use in normal way

<target xsi:type="Splunk" 
name="f"             
layout="${longdate} | ${uppercase:${level}} | ${message} | ${exception}"
host="{url-to-splunk}"
username="{your-username}"
password="{your-password}"
index="{your-index}"
source="{your-source}"
sourceType="{your-source-type}"
/>

Don't forget to add your rules

<logger name="*" minlevel="Info" writeTo="f" />

enter image description here

About

Splunk target to send logs in splunk

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages