Skip to content

Commit

Permalink
Serialize cronjob doc and remove type property (#5150)
Browse files Browse the repository at this point in the history
* serialize cronjob doc and remove type property

* Add Changelog

Co-authored-by: Álex Ruiz <[email protected]>
  • Loading branch information
asteriscos and AlexRuiz7 authored Jan 25, 2023
1 parent 57f0e9f commit 6a6ea1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Deploy new agent section: Fixed the way macos versions and architectures were displayed, fixed the way agents were displayed, fixed the way ubuntu versions were displayed. [#4933](https:/wazuh/wazuh-kibana-app/pull/4933)
- Fixed agent deployment instructions for HP-UX and Solaris. [#4943](https:/wazuh/wazuh-kibana-app/pull/4943)
- Fixed Inventory checks table filters by stats [#4999](https:/wazuh/wazuh-kibana-app/pull/4999)
- Fixed agent graph in opensearch dashboard [#4942] (https:/wazuh/wazuh-kibana-app/pull/4942)
- Fixed agent graph in opensearch dashboard [#4942](https:/wazuh/wazuh-kibana-app/pull/4942)
- Fixed commands in the deploy new agent section(most of the commands are missing '-1') [#4962](https:/wazuh/wazuh-kibana-app/pull/4962)
- Fixed agent installation command for macOS in the deploy new agent section. [#4968](https:/wazuh/wazuh-kibana-app/pull/4968)
- Fixed commands in the deploy new agent section(most of the commands are missing '-1') [#4984](https:/wazuh/wazuh-kibana-app/pull/4984)
Expand All @@ -79,6 +79,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Fixed menu content panel is displayed in the wrong place. [5092](https:/wazuh/wazuh-kibana-app/pull/5092)
- Fixed greyed and disabled menu section names [#5101](https:/wazuh/wazuh-kibana-app/pull/5101)
- Fixed mispelling in the NIST module [#5107](https:/wazuh/wazuh-kibana-app/pull/5107)
- Fixed Statistic cronjob bulk document insert [#5150](https:/wazuh/wazuh-kibana-app/pull/5150)
- Fixed the style of the buttons showing more event information in the event view table. [#5137](https:/wazuh/wazuh-kibana-app/pull/5137)

### Removed
Expand Down
10 changes: 3 additions & 7 deletions server/start/cron-scheduler/save-document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,11 @@ export class SaveDocument {
private createDocument(doc, index, mapping: string): BulkIndexDocumentsParams {
const createDocumentObject: BulkIndexDocumentsParams = {
index,
type: '_doc',
body: doc.flatMap(item => [{
index: { _index: index }
},
{
body: doc.map(item => `{"index": { "_index": "${index}" }}\n${JSON.stringify({
...this.buildData(item, mapping),
timestamp: new Date(Date.now()).toISOString()
}
])
})}\n`)
.join('')
};
log(this.logPath, `Document object: ${JSON.stringify(createDocumentObject)}`, 'debug');
return createDocumentObject;
Expand Down

0 comments on commit 6a6ea1f

Please sign in to comment.