From 26db4675f8e8ea7ad73b21fa6acb68c56f48efac Mon Sep 17 00:00:00 2001 From: "Joey F. Poon" Date: Tue, 7 Sep 2021 15:15:18 -0500 Subject: [PATCH] [Security Solution] add agent field to generator (#111428) --- .../common/endpoint/data_generators/fleet_agent_generator.ts | 4 ++++ .../common/endpoint/data_loaders/index_fleet_agent.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_agent_generator.ts b/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_agent_generator.ts index 79888d9a97187..61f71e2ee253b 100644 --- a/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_agent_generator.ts +++ b/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_agent_generator.ts @@ -82,6 +82,10 @@ export class FleetAgentGenerator extends BaseDataGenerator { action_seq_no: -1, active: true, enrolled_at: now, + agent: { + id: this.randomUUID(), + version: this.randomVersion(), + }, local_metadata: { elastic: { agent: { diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_fleet_agent.ts b/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_fleet_agent.ts index 52998b090e3b6..901af259a5d2b 100644 --- a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_fleet_agent.ts +++ b/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_fleet_agent.ts @@ -48,6 +48,10 @@ export const indexFleetAgentForHost = async ( ): Promise => { const agentDoc = fleetAgentGenerator.generateEsHit({ _source: { + agent: { + id: endpointHost.agent.id, + version: endpointHost.agent.version, + }, local_metadata: { elastic: { agent: {