NetStash 1.3.0

dotnet add package NetStash --version 1.3.0
NuGet\Install-Package NetStash -Version 1.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetStash" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NetStash --version 1.3.0
#r "nuget: NetStash, 1.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NetStash as a Cake Addin
#addin nuget:?package=NetStash&version=1.3.0

// Install NetStash as a Cake Tool
#tool nuget:?package=NetStash&version=1.3.0

NetStash

Logstash sender for .NET

Send events to logstash instance via TCP

Saves all events into a sqlite database to prevent loss from network issues

Automatic synchronization when network connection is stablished

Installation

Nugget Package: https://www.nuget.org/packages/NetStash

PM > Install-Package NetStash

Usage

NetStashLog log = new NetStashLog("myhostname", 1233, "NSTest", "NSTestLog");

Dictionary<string, string> vals = new Dictionary<string, string>();
//Additional fields
vals.Add("customerid", "1235");

log.Error("Testing", vals);

TLS Certificates

Note: certificateValidation = null >> Certificate validation will be discarded

NetStashLog log = new NetStashLog("myhostname", 1233, "NSTest", "NSTestLog", SslProtocols.Tls12, certificates, "domain.certificate.com", null);

Dictionary<string, string> vals = new Dictionary<string, string>();
//Additional fields
vals.Add("customerid", "1235");

log.Error("Testing", vals);

Logstash config

input {
  tcp {
    port => 1233
    host => "192.168.0.151"
    codec => json
  }
}
filter {
  mutate { gsub => ["message", "@($NL$)@", "\r\n"] }
}
output {
  elasticsearch {

  }
}

When to use

This project will work with ALL versions of elasticsearch.

If you just want to send log data, i recommend you to use NetStash.

If you are using elasticsearch 7+ and need to log error details: I strongly recommend you to use https://github.com/elastic/apm-agent-dotnet Apm Agent Dotnet. (I'm a contributor of this too)

Who is using

Iron Mountain Brasil

  • All internals logs systems.
Product Compatible and additional computed target framework versions.
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.0 4,651 12/3/2019
1.2.1 916 11/2/2018
1.1.0 1,921 5/6/2016