You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
I am trying to pass in values via the options file. However, it does not appear that the options for sourceHost or sourcePort are used correctly. I made two modifications to the source...
options.js:
exports.readOptionsFile = function(opts) {
if (!opts.optionsFile){
return;
}
if (!fs.existsSync(opts.optionsFile)) {
return 'The given options file could not be found.';
}
var fileOpts = JSON.parse(fs.readFileSync(opts.optionsFile));
for (var prop in fileOpts) {
if (!opts[prop] && !exports.overrides[prop]) {
console.log("Copying property %s", prop);
opts[prop] = fileOpts[prop];
} else {
console.log("Skipping property %s", prop);
}
}
};
I am trying to pass in values via the options file. However, it does not appear that the options for sourceHost or sourcePort are used correctly. I made two modifications to the source...
options.js:
exports.readOptionsFile = function(opts) {
if (!opts.optionsFile){
return;
}
if (!fs.existsSync(opts.optionsFile)) {
return 'The given options file could not be found.';
}
var fileOpts = JSON.parse(fs.readFileSync(opts.optionsFile));
for (var prop in fileOpts) {
if (!opts[prop] && !exports.overrides[prop]) {
console.log("Copying property %s", prop);
opts[prop] = fileOpts[prop];
} else {
console.log("Skipping property %s", prop);
}
}
};
and es.js:
this.source = {
get: function (opts, path, callback) {
console.log("create GET source %s %s %s %s", opts.sourceUseSSL, opts.sourceHost, opts.sourcePort, opts.sourceAuth);
return create(opts.sourceHttpProxy, opts.sourceUseSSL, opts.sourceHost, opts.sourcePort, opts.sourceAuth, path, 'GET', {}, callback);
},
Running with the provided options.json:
node exporter.js -o test/data/options.json
produces this output:
mpcarl] (master) $: node exporter.js -o test/data/options.json
Elasticsearch Exporter - Version 1.3.3
Skipping property sourceHost
Skipping property sourcePort
Copying property sourceIndex
Copying property sourceType
Copying property targetHost
Copying property targetPort
Copying property targetIndex
Copying property targetType
Reading source statistics from ElasticSearch
create GET source false localhost 9200 undefined
create GET source false localhost 9200 undefined
create GET source false localhost 9200 undefined
create GET source false localhost 9200 undefined
create GET source undefined host2 9201 undefined
create GET source undefined host2 9201 undefined
create GET source undefined host2 9201 undefined
create GET source undefined host2 9201 undefined
The text was updated successfully, but these errors were encountered: