markmcdowell / NLog.Targets.ElasticSearch

NLog target for Elasticsearch
MIT License
176 stars 89 forks source link

Read password from environment #80

Closed Baklap4 closed 5 years ago

Baklap4 commented 5 years ago

While trying to connect to Elastic cloud we now have to supply a username and password. Since the Uri parameter can be read from the environment using ${environment:SOME_ENV_HOST} i thought why not do the same with password. However this seems not to work because when sending the /_bulk the decoded auth header is the following: some_user:${environment:SOME_ENV_PASS} this obviously does not authenticate correctly with Elastic cloud resulting in an unauthorized...

markmcdowell commented 5 years ago

Yes, currently we're only passing in username and password if specified in config. It would make sense to allow environment variables though. Possibly ES_USER, ES_PASSWORD,...

snakefoot commented 5 years ago

Created PR #84

snakefoot commented 5 years ago

Ver. 6.1.0 has been released: https://www.nuget.org/packages/NLog.Targets.ElasticSearch