Using config.yml pattern whenever custom id is found

This commit is contained in:
Jesús Ángel González 2018-03-23 13:41:02 +01:00 committed by Javier Castro
parent 713e510138
commit 88a290d243

View File

@ -116,6 +116,13 @@ module.exports = (server, options) => {
try{
if(!id) return Promise.reject(new Error('No valid id for index pattern'));
if(!patternId) return Promise.reject(new Error('No valid patternId for index pattern'));
const customPatternRegex = new RegExp(/[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}/g);
if(id && customPatternRegex.test(id.trim())){
id = configurationFile.pattern;
patternId = 'index-pattern:' + id.trim();
}
await elasticRequest
.callWithInternalUser('create', {
index: '.kibana',