Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution][Detections] Fixes Rule Execution Log events potentially being out of order when providing status filters and max events are hit #131675

Merged
merged 12 commits into from
Jul 11, 2022
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,16 @@ export const createEventLogReader = (eventLog: IEventLogClient): IEventLogReader
filteredExecutionUUIDs: {
terms: {
field: EXECUTION_UUID_FIELD,
order: { executeStartTime: 'desc' },
size: MAX_EXECUTION_EVENTS_DISPLAYED,
},
aggs: {
executeStartTime: {
min: {
field: '@timestamp',
},
},
},
},
},
});
Expand Down Expand Up @@ -113,7 +121,7 @@ export const createEventLogReader = (eventLog: IEventLogClient): IEventLogReader
maxExecutions: MAX_EXECUTION_EVENTS_DISPLAYED,
page,
perPage,
sort: [{ [sortField]: { order: sortOrder } }] as estypes.Sort,
sort: [{ [sortField]: { order: sortOrder } }],
}),
});

Expand Down