Open snebjorn opened 2 years ago
Hi,
you can use like this
{
"Name": "Elasticsearch",
"Args": {
"nodeUris": "https://.............../;",
"connectionGlobalHeaders": "Authorization=Basic {XXX}",
}
}
where {XXX} is {username}:{password}
in base64 format
Thanks for the suggestion. However {username}:{password}
is different from an API key.
when is this going to be implemented?
When somebody submits a PR for this functionality. Alternatively, look at the sink Elastic itself offers if this is a better match. You can find a link in the readme.
Thanks for the suggestion. However
{username}:{password}
is different from an API key.
Didn't test it, but from looking at the official API key documentation, it looks like this might work:
"connectionGlobalHeaders": "Authorization=ApiKey {XXX}",
Where XXX is the base64 encoded API key. Source: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
Does this issue relate to a new feature or an existing bug?
What version of Serilog.Sinks.Elasticsearch is affected? Please list the related NuGet package. serilog.sinks.elasticsearch v8.4.1
What is the target framework and operating system? See target frameworks & net standard matrix.
Please describe the current behavior?
Not possible to set api keys from appsettings.json. Today it has to be done from code
Please describe the expected behavior?
It would be handy if we could configure authentication like api keys from appsettings.json
Something like