diff --git a/src/plugins/kibana/server/routes/api/ingest/register_delete.js b/src/plugins/kibana/server/routes/api/ingest/register_delete.js index 92a020d8435dd..fb81655f1da04 100644 --- a/src/plugins/kibana/server/routes/api/ingest/register_delete.js +++ b/src/plugins/kibana/server/routes/api/ingest/register_delete.js @@ -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 }; diff --git a/src/plugins/kibana/server/routes/api/ingest/register_post.js b/src/plugins/kibana/server/routes/api/ingest/register_post.js index b36b778232fdd..fe944f5307055 100644 --- a/src/plugins/kibana/server/routes/api/ingest/register_post.js +++ b/src/plugins/kibana/server/routes/api/ingest/register_post.js @@ -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 };