From f310b46c30c134c452e4c2b7ef860527a129494a Mon Sep 17 00:00:00 2001 From: tsm Date: Sun, 15 Oct 2017 23:34:50 +0200 Subject: [PATCH] Fix basic auth for elasticsearch module elasticsearch looking for httpAuth, not auth key - [config options for elasticsearch.Client](https://github.com/elastic/elasticsearch-js/blob/8cf09a381db61478082d8f964e5fe5ac96bb7c5e/docs/configuration.asciidoc#config-options) - https://github.com/elastic/elasticsearch-js/blob/master/src/lib/host.js#L104 --- pino-elasticsearch.js | 1 + 1 file changed, 1 insertion(+) diff --git a/pino-elasticsearch.js b/pino-elasticsearch.js index 4ac4fc0..3f32656 100644 --- a/pino-elasticsearch.js +++ b/pino-elasticsearch.js @@ -33,6 +33,7 @@ function pinoElasticSearch (opts) { const client = new elasticsearch.Client({ host: opts.host ? opts.host + ':' + opts.port : undefined, auth: opts.user ? opts.user + ':' + opts.password : undefined, + httpAuth: opts.user ? opts.user + ':' + opts.password : undefined, connectionClass: opts['aws-credentials'] ? require('http-aws-es') : undefined, awsConfig: opts['aws-credentials'] ? AWS.config.loadFromPath(opts['aws-credentials']) : undefined, log: {