mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-06 09:55:18 +00:00
Proper index-pattern ids
This commit is contained in:
parent
6b9f21686a
commit
daa917d500
@ -146,10 +146,11 @@ module.exports = (server, options) => {
|
||||
const createIndexPattern = () => {
|
||||
server.log([blueWazuh, 'initialize', 'info'], `Creating index pattern: ${index_pattern}`);
|
||||
|
||||
let patternId = 'index-pattern:' + index_pattern;
|
||||
elasticRequest.callWithInternalUser('create', {
|
||||
index: '.kibana',
|
||||
type: 'doc',
|
||||
id: 'index-pattern:f1175040-d5c5-11e7-8ef5-a5944cf52264',
|
||||
id: patternId,
|
||||
body: {
|
||||
"type": 'index-pattern',
|
||||
"index-pattern": {
|
||||
@ -161,11 +162,11 @@ module.exports = (server, options) => {
|
||||
.then((resp) => {
|
||||
server.log([blueWazuh, 'initialize', 'info'], 'Created index pattern: ' + index_pattern);
|
||||
// Import objects (dashboards and visualizations)
|
||||
importObjects('f1175040-d5c5-11e7-8ef5-a5944cf52264');
|
||||
importAppObjects('f1175040-d5c5-11e7-8ef5-a5944cf52264');
|
||||
importObjects(index_pattern);
|
||||
importAppObjects(index_pattern);
|
||||
|
||||
// Save Setup Info
|
||||
saveConfiguration('f1175040-d5c5-11e7-8ef5-a5944cf52264');
|
||||
saveConfiguration(index_pattern);
|
||||
})
|
||||
.catch((err) => {
|
||||
server.log([blueWazuh, 'initialize', 'error'], 'Error creating index-pattern.');
|
||||
|
@ -194,10 +194,11 @@ module.exports = (server, options) => {
|
||||
const configureKibana = () => {
|
||||
server.log([blueWazuh, 'monitoring', 'info'], `Creating index pattern: ${index_pattern}`);
|
||||
|
||||
elasticRequest.callWithInternalUser('create', {
|
||||
let patternId = 'index-pattern:' + index_pattern;
|
||||
elasticRequest.callWithInternalUser('create', {
|
||||
index: '.kibana',
|
||||
type: 'doc',
|
||||
id: 'index-pattern:f1185040-d5c5-11e7-8ef5-a5944cf52264',
|
||||
id: patternId,
|
||||
body: {
|
||||
"type": 'index-pattern',
|
||||
"index-pattern": {
|
||||
@ -208,7 +209,7 @@ module.exports = (server, options) => {
|
||||
})
|
||||
.then((resp) => {
|
||||
server.log([blueWazuh, 'monitoring', 'info'], 'Created index pattern: ' + index_pattern);
|
||||
importAppObjects('f1185040-d5c5-11e7-8ef5-a5944cf52264');
|
||||
importAppObjects(index_pattern);
|
||||
})
|
||||
.catch((error) => {
|
||||
server.log([blueWazuh, 'monitoring', 'error'], 'Error creating index-pattern due to ' + error);
|
||||
@ -275,10 +276,11 @@ module.exports = (server, options) => {
|
||||
server.log([blueWazuh, 'monitoring', 'info'], 'Creating today index...');
|
||||
saveStatus();
|
||||
|
||||
let patternId = 'index-pattern:' + index_pattern;
|
||||
elasticRequest.callWithInternalUser('get', {
|
||||
index: '.kibana',
|
||||
type: 'doc',
|
||||
id: 'index-pattern:f1185040-d5c5-11e7-8ef5-a5944cf52264'
|
||||
id: patternId
|
||||
})
|
||||
.then((data) => {
|
||||
server.log([blueWazuh, 'monitoring', 'info'], 'Skipping index-pattern creation. Already exists.');
|
||||
|
Loading…
Reference in New Issue
Block a user