Skip to content

Commit

Permalink
Merge pull request #6535 from Bargs/fix/ingestKibanaIndex
Browse files Browse the repository at this point in the history
Fix #6490 ingest API should respect kibana.index config
  • Loading branch information
Rashid Khan committed Mar 14, 2016
2 parents dc87fe1 + 57b09c5 commit 6a1e087
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/kibana/server/routes/api/ingest/register_post.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -36,7 +37,7 @@ module.exports = function registerPost(server) {
}

const patternCreateParams = {
index: '.kibana',
index: kibanaIndex,
type: 'index-pattern',
id: indexPatternId,
body: indexPattern
Expand Down Expand Up @@ -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
};
Expand Down

0 comments on commit 6a1e087

Please sign in to comment.