[Security Solution] fix endpoint metadata API list sorting (#154638)

This commit is contained in:
Joey F. Poon 2023-04-10 19:35:22 -05:00 committed by GitHub
parent 2e75a02032
commit 979cb7350e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,6 +55,10 @@ export const MetadataSortMethod: estypes.SortCombinations[] = [
},
];
const UnitedMetadataSortMethod: estypes.SortCombinations[] = [
{ 'united.agent.enrolled_at': { order: 'desc', unmapped_type: 'date' } },
];
export function getESQueryHostMetadataByID(agentID: string): estypes.SearchRequest {
return {
body: {
@ -206,7 +210,7 @@ export async function buildUnitedIndexQuery(
body: {
query,
track_total_hits: true,
sort: MetadataSortMethod,
sort: UnitedMetadataSortMethod,
fields,
runtime_mappings: runtimeMappings,
},