HTTPDataCollectorAPI 1.0.5
dotnet add package HTTPDataCollectorAPI --version 1.0.5
NuGet\Install-Package HTTPDataCollectorAPI -Version 1.0.5
<PackageReference Include="HTTPDataCollectorAPI" Version="1.0.5" />
paket add HTTPDataCollectorAPI --version 1.0.5
#r "nuget: HTTPDataCollectorAPI, 1.0.5"
// Install HTTPDataCollectorAPI as a Cake Addin #addin nuget:?package=HTTPDataCollectorAPI&version=1.0.5 // Install HTTPDataCollectorAPI as a Cake Tool #tool nuget:?package=HTTPDataCollectorAPI&version=1.0.5
Azure Log Analytics HTTP Collector API wrapper
This package is a .Net adaptation of the Powershell code for implementing the HTTP Collector API for Azure Log Analytics as seen on the announcement.
Get it
You can obtain this project as a Nuget Package.
Install-Package HTTPDataCollectorAPI
Or reference it and use it according to the License.
Use it
Using it is simple:
var collector = new HTTPDataCollectorAPI.Collector("{Your_Workspace_Id}", "{Your_Workspace_Key}");
await collector.Collect("TestLogType", "{\"TestAttribute\":\"TestValue\"}");
You can also pass serializable objects (they will be serialized with Newtonsoft.Json):
var anObject = new MySerializableClass(){
MyIntAttribute = 4,
MyStringAttribute = "hello",
MyListAttribute = new List<string>(){"one","two"}
};
var collector = new HTTPDataCollectorAPI.Collector("{Your_Workspace_Id}", "{Your_Workspace_Key}");
await collector.Collect("TestLogType", anObject);
If you are using a Depedency Injection mechanism (or ASP.NET Core) you can use the available interface. In ASP.NET Core for example:
public void ConfigureServices(IServiceCollection services)
{
//... some other code
services.AddSingleton<HTTPDataCollectorAPI.ICollector, HTTPDataCollectorAPI.Collector>();
}
Does it work on Azure Gov clouds?
Yes, just use the constructor overload to define the cloud service endpoint:
var collector = new HTTPDataCollectorAPI.Collector("{Your_Workspace_Id}", "{Your_Workspace_Key}", "ods.opinsights.azure.us");
Issues
Please feel free to report any issues you might encounter. Keep in mind that this library won't assure that your JSON payloads are being indexed, it will make sure that the HTTP Data Collection API responds an Accept but there is no way (right now) to know when has the payload been indexed completely.
Supported Frameworks
- .Net 4.5 Full Framework
- .Net 4.6 Full Framework
- .Net 4.6.1 Full Framework
- .Net Standard Library 1.3
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 | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.3 is compatible. netstandard1.4 was computed. netstandard1.5 was computed. netstandard1.6 was computed. netstandard2.0 was computed. netstandard2.1 was computed. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 is compatible. net461 is compatible. 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 | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Universal Windows Platform | uap was computed. uap10.0 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.5
- Newtonsoft.Json (>= 9.0.1)
-
.NETFramework 4.6
- Newtonsoft.Json (>= 9.0.1)
-
.NETFramework 4.6.1
- Newtonsoft.Json (>= 9.0.1)
-
.NETStandard 1.3
- NETStandard.Library (>= 1.6.0)
- Newtonsoft.Json (>= 9.0.1)
- System.Net.Requests (>= 4.0.11)
- System.Security.Cryptography.Algorithms (>= 4.2.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on HTTPDataCollectorAPI:
Package | Downloads |
---|---|
LogAnalytics.Extensions.Logging
Azure LogAnalytics provider for Microsoft.Extensions.Logging |
|
Components.LogAnalytics
Componente para registro de log centralizado en Log Analytics. |
GitHub repositories
This package is not used by any popular GitHub repositories.