NLogTarget.Splunk
1.0.1
See the version list below for details.
dotnet add package NLogTarget.Splunk --version 1.0.1
NuGet\Install-Package NLogTarget.Splunk -Version 1.0.1
<PackageReference Include="NLogTarget.Splunk" Version="1.0.1" />
paket add NLogTarget.Splunk --version 1.0.1
#r "nuget: NLogTarget.Splunk, 1.0.1"
// Install NLogTarget.Splunk as a Cake Addin #addin nuget:?package=NLogTarget.Splunk&version=1.0.1 // Install NLogTarget.Splunk as a Cake Tool #tool nuget:?package=NLogTarget.Splunk&version=1.0.1
It is recommended that async
mode is set in NLog configuration. In async
mode the log entries are sent in batches.
Resolving AuthToken
It is highly recommended that the AuthToken
value is resolved from a secrets vault rather then NLog.config. You can extend this library and write a custom AuthToken resolution method in InitializeTarget()
. Unfortunately, NLog does not support "MethodPointer" configuration parameter types.
Sample NLog.config
The required parameters are
endpoint
- HEC URL, such as https://sample.org/services/collector/eventauthToken
- Authentication tokenindex
- An index to which to send the event logs tosource
- Identifies the source of the event logs
Optional parameters are
ignoreSSLErrors
-False
by default. IfTrue
, ssl errors are ignored when posting to the HEC endpointtimeout
- # of milliseconds to wait before aborting a POST to HEC endpoint. Default is 30000 (30 seconds).
Keep in mind that the timestamp must be sent along with the log entries. The library will set the timestamp to the current time (DateTime.Now
) so ensure that the time across your servers is synchronized.
<?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"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="false"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="C:\logs\nlog_internal.log">
<extensions>
<add assembly="NLogTarget.Splunk"/>
</extensions>
<targets async="true">
<target xsi:type="Splunk" name="splunk" endpoint="https://sample.org/services/collector/event" authToken="***" index="sample_index" source="http:your_app">
<layout xsi:type="JsonLayout" includeAllProperties="true">
<attribute name="logger" layout="${logger}" />
<attribute name="severity" layout="${level}" />
<attribute name="callsite" layout="${callsite:includeSourcePath=false:className=false}" />
<attribute name="message" layout="${message}" />
<attribute name="error" layout="${exception:format=ToString}" />
</layout>
</target>
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="Splunk" />
</rules>
</nlog>
- Enjoy Responsibly -
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 11.0.2)
- NLog (>= 4.5.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release