Merge pull request #6535 from Bargs/fix/ingestKibanaIndex

Fix #6490 ingest API should respect kibana.index config
This commit is contained in:
Rashid Khan 2016-03-14 16:44:34 -07:00
commit 6a1e087c62
2 changed files with 5 additions and 3 deletions

View file

@ -7,9 +7,10 @@ module.exports = function registerDelete(server) {
path: '/api/kibana/ingest/{id}',
method: 'DELETE',
handler: function (req, reply) {
const kibanaIndex = server.config().get('kibana.index');
const callWithRequest = server.plugins.elasticsearch.callWithRequest;
const deletePatternParams = {
index: '.kibana',
index: kibanaIndex,
type: 'index-pattern',
id: req.params.id
};

View file

@ -17,6 +17,7 @@ module.exports = function registerPost(server) {
}
},
handler: function (req, reply) {
const kibanaIndex = server.config().get('kibana.index');
const callWithRequest = server.plugins.elasticsearch.callWithRequest;
const requestDocument = _.cloneDeep(req.payload);
const indexPatternId = requestDocument.id;
@ -36,7 +37,7 @@ module.exports = function registerPost(server) {
}
const patternCreateParams = {
index: '.kibana',
index: kibanaIndex,
type: 'index-pattern',
id: indexPatternId,
body: indexPattern
@ -74,7 +75,7 @@ module.exports = function registerPost(server) {
return callWithRequest(req, 'indices.putTemplate', templateParams)
.catch((templateError) => {
const deleteParams = {
index: '.kibana',
index: kibanaIndex,
type: 'index-pattern',
id: indexPatternId
};