elastic / elastic/ecs-dotnet

[QUESTION] Support for log forwarding through Elastic Agent using Custom HTTP Logs integration

Open
#409 0 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
HTML
Stars
137
Forks
70
PR merge metrics
No merged PRs in 30d

Description

Is it possible to use the Elastic.Serilog.Sinks package to send logs to an Elastic Agent having the Custom HTTP Logs integration?

From serilog-contrib/serilog-sinks-elasticsearch#486:
> [Elastic.Serilog.Sinks](https://www.nuget.org/packages/Elastic.Serilog.Sinks#readme-body-tab) will not only target Elasticsearch.
Long term we will explore it sending data to our APM product, OTLP, Logstash, Elastic Agent and many others.

In my testing with an agent having the custom logs integration listening on port 8080, I'm getting an error.

```csharp
config.WriteTo.Elasticsearch(new[] { new Uri("http://localhost:8080") }, opts =>
{
opts.DataStream = new DataStreamName("logs", "dotnet", "default");
opts.BootstrapMethod = BootstrapMethod.Failure;
});
```

Error:
```
System.Exception: Failure to create component template `ecs_8.11.0_agent` for logs-dotnet-*: Invalid Elasticsearch response built from a unsuccessful (405) low level call on PUT: /_component_template/ecs_8.11.0_agent
Exception: Failed to ping the specified node. Call: Status code 405 from: HEAD /
```

If this is not supported, is it planned?

Is there an alternate way to use Serilog to send logs via an agent? We have certain authorization considerations that will not allow us to push logs directly to our Elastic Cloud instance.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.