https://github.com/serilog-contrib/serilog-sinks-splunk
A Serilog sink that writes to Splunk
https://github.com/serilog-contrib/serilog-sinks-splunk
serilog serilog-sink splunk
Last synced: 12 months ago
JSON representation
A Serilog sink that writes to Splunk
- Host: GitHub
- URL: https://github.com/serilog-contrib/serilog-sinks-splunk
- Owner: serilog-contrib
- License: apache-2.0
- Created: 2015-02-04T21:57:09.000Z (over 11 years ago)
- Default Branch: dev
- Last Pushed: 2024-09-09T19:00:46.000Z (almost 2 years ago)
- Last Synced: 2024-09-09T23:31:01.157Z (almost 2 years ago)
- Topics: serilog, serilog-sink, splunk
- Language: C#
- Homepage: https://splunk.com
- Size: 492 KB
- Stars: 46
- Watchers: 7
- Forks: 47
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Serilog.Sinks.Splunk

[](https://www.nuget.org/packages/Serilog.Sinks.Splunk)
[](https://gitter.im/serilog/serilog)
A Serilog sink that writes events to the [Splunk](https://splunk.com). Supports .NET 4.5+, .NET Core, and platforms compatible with the [.NET Platform Standard](https://docs.microsoft.com/en-us/dotnet/standard/net-standard) `net45`, `netstandard1.1`, `netstandard2.0`.
[](https://nuget.org/packages/serilog.sinks.splunk)
**Package** - [Serilog.Sinks.Splunk](https://nuget.org/packages/serilog.sinks.splunk)
## Getting started
To get started install the *Serilog.Sinks.Splunk* package:
```powershell
PM> Install-Package Serilog.Sinks.Splunk
```
OR
```bash
$ dotnet add package Serilog.Sinks.Splunk
```
If using the `TCP` or `UDP` sinks install the following packages
* TCP: `Serilog.Sinks.Splunk.TCP`
* UDP: `Serilog.Sinks.Splunk.UDP`
To start using the Splunk Event Collector (Splunk 6.3 and above), logging can be setup as follows.
```csharp
var log = new LoggerConfiguration()
.WriteTo.EventCollector("https://mysplunk:8088/services/collector/event", "myeventcollectortoken")
.CreateLogger();
```
If using `appsettings.json` for configuration the following example illustrates using the Event Collector and Console sinks.
```javascript
{
"Serilog": {
"Using": ["Serilog.Sinks.Console", "Serilog.Sinks.Splunk"],
"MinimumLevel": "Information",
"WriteTo": [{
"Name": "Console"
},
{
"Name": "EventCollector",
"Args": {
"splunkHost": "http://splunk:8088",
"uriPath": "services/collector/event",
"eventCollectorToken": "00112233-4455-6677-8899-AABBCCDDEEFF"
}
}
],
"Properties": {
"Application": "Serilog Splunk Console Sample"
}
}
}
```
More information about Serilog is available on the [wiki](https://github.com/serilog/serilog-sinks-splunk/wiki).
_Serilog is copyright © 2013-2024 Serilog Contributors - Provided under the [Apache License, Version 2.0](http://apache.org/licenses/LICENSE-2.0.html). Needle and thread logo a derivative of work by [Kenneth Appiah](http://www.kensets.com/)._