diff --git a/x-pack/plugins/endpoint/common/generate_data.ts b/x-pack/plugins/endpoint/common/generate_data.ts index 9742725c9e1ca2..2e7181bf5e10b0 100644 --- a/x-pack/plugins/endpoint/common/generate_data.ts +++ b/x-pack/plugins/endpoint/common/generate_data.ts @@ -339,9 +339,9 @@ export class EndpointDocGenerator { for (let i = 0; i < ancestry.length; i++) { yield ancestry[i]; } - // ancestry will always have at least 2 elements, and the second to last element will be the process associated with the alert + // ancestry will always have at least 2 elements, and the last element will be the process associated with the alert yield* this.descendantsTreeGenerator( - ancestry[ancestry.length - 2], + ancestry[ancestry.length - 1], childGenerations, maxChildrenPerNode, relatedEventsPerNode,