We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bfc8e96 commit 4f7d18bCopy full SHA for 4f7d18b
1 file changed
x-pack/plugins/security_solution/server/endpoint/routes/actions/audit_log_handler.ts
@@ -78,10 +78,16 @@ export const actionsLogRequestHandler = (
78
}
79
80
return res.ok({
81
- body: result.body.hits.hits.map((e) => {
82
- const type = /^.fleet-actions-\d+$/.test(e._index) ? 'action' : 'response';
83
- return { type, item: e._source };
84
- }),
+ body: {
+ total:
+ typeof result.body.hits.total === 'number'
+ ? result.body.hits.total
85
+ : result.body.hits.total.value,
86
+ items: result.body.hits.hits.map((e) => ({
87
+ type: e._index.startsWith('.fleet-actions') ? 'action' : 'response',
88
+ item: { id: e._id, data: e._source },
89
+ })),
90
+ },
91
});
92
};
93
0 commit comments