Elastic.Ingest.Elasticsearch.CommonSchema 8.4.0-alpha1

Elastic.Ingest.Elasticsearch.CommonSchema

A specialization of Elastic.Ingest.Elasticsearch that offers two channel implementations that make it easy to write ECS formatted data and bootstrap the target datastreams/indices with ECS mappings and settings.

EcsDataStreamChannel<TEvent>

A channel that specializes to writing data with a timestamp to Elasticsearch data streams.

A channel can be created to push data to the logs-dotnet-default data stream.

var dataStream = new DataStreamName("logs", "dotnet");
var bufferOptions = new BufferOptions { }
var options = new DataStreamChannelOptions<EcsDocument>(transport)
{
  DataStream = dataStream,
  BufferOptions = bufferOptions
};
var channel = new EcsDataStreamChannel<EcsDocument>(options);

NOTE: read more about Elastic's data stream naming convention here: https://www.elastic.co/blog/an-introduction-to-the-elastic-data-stream-naming-scheme

we can now push data to Elasticsearch using the EcsDataStreamChannel

var doc = new EcsDocument 
{ 
    Timestamp = DateTimeOffset.Now, 
    Message = "Hello World!", 
}
channel.TryWrite(doc);

EcsIndexChannel<TEvent>

A channel that specializes in writing catalog data to Elastic indices.

We can create an EcsIndexChannel<> to push EcsDocument (or subclassed) instances.

var options = new IndexChannelOptions<EcsDocument>(transport)
{
    IndexFormat = "catalog-data-{0:yyyy.MM.dd}",
    // BulkOperationIdLookup = c => null,
    TimestampLookup = c => c.Timestamp,
};
var channel = new EcsIndexChannel<CatalogDocument>(options);

now we can push data using:

var doc = new CatalogDocument 
{ 
    Created = date, 
    Title = "Hello World!", 
    Id = "hello-world" 
}
channel.TryWrite(doc);

This will push data to catalog-data-2023.01.1 because TimestampLookup yields Timestamp to IndexFormat.

IndexFormat can also simply be a fixed string to write to an Elasticsearch alias/index.

BulkOperationIdLookup determines if the document should be pushed to Elasticsearch using a create or index operation.

Bootstrapping target Datastream or Index

Optionally the target data stream or index can be bootstrapped using the following.

await channel.BootstrapElasticsearchAsync(BootstrapMethod.Failure, "7-days-default"); 

This will bootstrap:

If the index template already exists no further bootstrapping will occur.

Just like Elastic.Ingest.Elasticsearch the channel is aware that logs and metrics have default component templates and ensures the new index tempate references them.

Showing the top 20 packages that depend on Elastic.Ingest.Elasticsearch.CommonSchema.

Packages Downloads
Elastic.CommonSchema.BenchmarkDotNetExporter
Exports BenchmarkDotNet benchmarks to Elasticsearch using Elastic Common Schema (ECS) format
25
Elastic.CommonSchema.BenchmarkDotNetExporter
Exports BenchmarkDotNet benchmarks to Elasticsearch using Elastic Common Schema (ECS) format
26
Elastic.CommonSchema.BenchmarkDotNetExporter
Exports BenchmarkDotNet benchmarks to Elasticsearch using Elastic Common Schema (ECS) format
27
Elastic.CommonSchema.BenchmarkDotNetExporter
Exports BenchmarkDotNet benchmarks to Elasticsearch using Elastic Common Schema (ECS) format
29
Elastic.CommonSchema.BenchmarkDotNetExporter
Exports BenchmarkDotNet benchmarks to Elasticsearch using Elastic Common Schema (ECS) format
31
Elastic.CommonSchema.BenchmarkDotNetExporter
Exports BenchmarkDotNet benchmarks to Elasticsearch using Elastic Common Schema (ECS) format
33
Elastic.CommonSchema.BenchmarkDotNetExporter
Exports BenchmarkDotNet benchmarks to Elasticsearch using Elastic Common Schema (ECS) format
34
Elastic.CommonSchema.BenchmarkDotNetExporter
Exports BenchmarkDotNet benchmarks to Elasticsearch using Elastic Common Schema (ECS) format
35
Elastic.CommonSchema.BenchmarkDotNetExporter
Exports BenchmarkDotNet benchmarks to Elasticsearch using Elastic Common Schema (ECS) format
36
Elastic.CommonSchema.BenchmarkDotNetExporter
Exports BenchmarkDotNet benchmarks to Elasticsearch using Elastic Common Schema (ECS) format
39
Elastic.CommonSchema.BenchmarkDotNetExporter
Exports BenchmarkDotNet benchmarks to Elasticsearch using Elastic Common Schema (ECS) format
40
Elastic.CommonSchema.BenchmarkDotNetExporter
Exports BenchmarkDotNet benchmarks to Elasticsearch using Elastic Common Schema (ECS) format
41
Elastic.CommonSchema.BenchmarkDotNetExporter
Exports BenchmarkDotNet benchmarks to Elasticsearch using Elastic Common Schema (ECS) format
42

https://github.com/elastic/ecs-dotnet/releases

.NET Standard 2.1

Version Downloads Last updated
9.0.0 34 08/15/2025
8.19.0 23 08/15/2025
8.18.2 28 06/28/2025
8.18.1 33 06/04/2025
8.18.0 28 05/24/2025
8.12.3 41 01/01/2025
8.12.2 36 01/01/2025
8.12.1 40 01/01/2025
8.12.0 37 01/01/2025
8.11.1 33 01/01/2025
8.11.0 35 01/01/2025
8.6.1 36 01/01/2025
8.6.0 39 01/01/2025
8.4.0-alpha4 33 01/01/2025
8.4.0-alpha3 37 01/01/2025
8.4.0-alpha2 34 01/01/2025
8.4.0-alpha1 37 01/01/2025