We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to use different index! well! if change the
swagger-stats/schema/elasticsearch/api_index_template.json
Line 2 in 1a61c6c
"template": "server-1-*",
ok?
or
app.use(swStats.getMiddleware({ elasticsearch: "http://10.40.2.89:9200", elasticsearchIndex: "server-1-*" // Configuration els index }));
swagger-stats/lib/swsUtil.js
Line 11 in 1a61c6c
// swagger-stats supported options module.exports.supportedOptions = { // .... // ElasticSearch URL. Enables storing of request response records in Elasticsearch. // Default is empty (disabled). elasticsearch: "elasticsearch", elasticsearchIndex: "api-*", // elk default index //... };
swagger-stats/lib/swsElasticEmitter.js
Line 42 in 1a61c6c
// Initialize swsElasticEmitter.prototype.initialize = function(swsOptions) { if (typeof swsOptions === 'undefined') return; if (!swsOptions) return; this.options = swsOptions; // Set or detect hostname if (!(swsUtil.supportedOptions.elasticsearch in swsOptions)) { debug('Elasticsearch is disabled'); return; } if (this.options.elasticsearchIndex) { indexTemplate.template = this.options.elasticsearchIndex } //...... };
Line 144 in 1a61c6c
// Index Request Response Record swsElasticEmitter.prototype.processRecord = function(rrr) { //... // Create metadata var indexName = this.options.elasticsearchIndex + moment(rrr['@timestamp']).utc().format('YYYY.MM.DD'); var meta = { index: { _index: indexName, _type: this.options.elasticsearchIndex, _id: rrr.id } }; // console.log(indexTemplate) // Add to buffer // ..... };
it is ok?
The text was updated successfully, but these errors were encountered:
Looks right, thanks ! Will add soon
Sorry, something went wrong.
New option elasticsearchIndexPrefix. #47, #45
951366a
new option elasticsearchIndexPrefix is added. Use this option to specify desired index prefix, for example:
elasticsearchIndexPrefix
// Enable swagger-stats middleware app.use(swStats.getMiddleware({ name: 'swagger-stats-testapp', version: '0.95.6', timelineBucketDuration: tlBucket, uriPath: '/swagger-stats', swaggerSpec:swaggerSpec, elasticsearch:'http://127.0.0.1:9200', elasticsearchIndexPrefix:'swagger-stats-', onResponseFinish: function(req,res,rrr){ debug('onResponseFinish: %s', JSON.stringify(rrr)); } }));
sv2
No branches or pull requests
I want to use different index!
well!
if change the
swagger-stats/schema/elasticsearch/api_index_template.json
Line 2 in 1a61c6c
change to
ok?
or
swagger-stats/lib/swsUtil.js
Line 11 in 1a61c6c
swagger-stats/lib/swsElasticEmitter.js
Line 42 in 1a61c6c
swagger-stats/lib/swsElasticEmitter.js
Line 144 in 1a61c6c
it is ok?
The text was updated successfully, but these errors were encountered: