mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-07 10:18:57 +00:00
Using config.yml pattern whenever custom id is found
This commit is contained in:
parent
713e510138
commit
88a290d243
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user