Table of Contents

Class ElasticsearchAuditSink

Namespace
JD.AI.Core.Governance.Audit
Assembly
JD.AI.Core.dll

POSTs audit events as JSON documents to an Elasticsearch index via {endpoint}/{index}/_doc. The index name supports date templating: {index} with {yyyy.MM} substituted with the event's month.

public sealed class ElasticsearchAuditSink : IAuditSink
Inheritance
ElasticsearchAuditSink
Implements
Inherited Members

Constructors

ElasticsearchAuditSink(HttpClient, string, string, string?)

public ElasticsearchAuditSink(HttpClient httpClient, string endpoint, string indexTemplate, string? token = null)

Parameters

httpClient HttpClient
endpoint string
indexTemplate string
token string

Properties

Name

public string Name { get; }

Property Value

string

Methods

FlushAsync(CancellationToken)

public Task FlushAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task

WriteAsync(AuditEvent, CancellationToken)

public Task WriteAsync(AuditEvent evt, CancellationToken ct = default)

Parameters

evt AuditEvent
ct CancellationToken

Returns

Task