I tried to make Serilog.Sinks.Elasticsearch work with ApiKeyAuthentication, however, it only worked with BasicAuthentication.
I tried with two overloads of the ApiKeyAuthentication method:
ApiKeyAuthentication(ApiKeyAuthenticationCredentials credentials)ApiKeyAuthentication(string id, string apiKey)
but the sink doesn't work with ApiKeyAuthentication.

However, when I use the BasicAuthentication(string username, string password) it works well.
I know that I need to use an apikey with index create e index pattern create authorization, so I created an apikey with these roles and beyond but still doesn't work.
Also, all the examples I found use BasicAuthentication.