mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-07 10:18:57 +00:00
Adding cluster object to documents from monitoring index. closes #375
This commit is contained in:
parent
89fbdb6163
commit
5763e3abab
@ -208,12 +208,12 @@ module.exports = (server, options) => {
|
||||
let body = '';
|
||||
if (agentsArray.length > 0) {
|
||||
let managerName = agentsArray[0].name;
|
||||
|
||||
for(let element of agentsArray) {
|
||||
body += '{ "index": { "_index": "' + todayIndex + '", "_type": "wazuh-agent" } }\n';
|
||||
let date = new Date(Date.now()).toISOString();
|
||||
element["@timestamp"] = date;
|
||||
element["host"] = managerName;
|
||||
element['@timestamp'] = date;
|
||||
element.host = managerName;
|
||||
element.cluster = { name: element.cluster && element.cluster.name ? element.cluster.name : 'disabled' } ;
|
||||
body += JSON.stringify(element) + "\n";
|
||||
}
|
||||
if (body === '') return;
|
||||
|
Loading…
Reference in New Issue
Block a user