mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Merge pull request #6535 from Bargs/fix/ingestKibanaIndex
Fix #6490 ingest API should respect kibana.index config
This commit is contained in:
commit
6a1e087c62
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
};
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue