diff --git a/bin/index.js b/bin/index.js index db3a754..0bdb231 100644 --- a/bin/index.js +++ b/bin/index.js @@ -6,9 +6,10 @@ const mod = require('../src/index.mjs').default; const logger = require('../src/lib/logger.mjs').default; const { index, interval, ...elasticsearch } = getopts(process.argv.slice(2), { - string: ['host', 'log'], + string: ['host', 'auth', 'log', 'index'], alias: { h: 'host', + u: 'auth', l: 'log', i: 'index', t: 'interval', diff --git a/src/index.mjs b/src/index.mjs index a7b2d31..7156c51 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -9,6 +9,7 @@ export default async function(indexName, opts = {}) { const client = new elasticsearch.Client({ host: opts.elasticsearch.host, log: opts.elasticsearch.log, + httpAuth: opts.elasticsearch.auth, }); // make sure we can connect to the node