From d97e6b57be9eef1a2308d0d3526478451ed1f24d Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 22 Aug 2023 17:12:28 +0000 Subject: [PATCH] [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' --- .../server/rule_types/geo_containment/lib/alert_context.ts | 7 ++++--- .../rule_types/geo_containment/lib/transform_results.ts | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/lib/alert_context.ts b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/lib/alert_context.ts index 0ab2a08b4e7bb7..6550a681e0321d 100644 --- a/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/lib/alert_context.ts +++ b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/lib/alert_context.ts @@ -50,9 +50,10 @@ function getAlertContext({ entityId: entityName, entityDateTime: containment.dateInShape || null, entityDocumentId: containment.docId, - entityLocation: containment.locationWkt !== undefined - ? containment.locationWkt - : `POINT (${containment.location[0]} ${containment.location[1]})`, + entityLocation: + containment.locationWkt !== undefined + ? containment.locationWkt + : `POINT (${containment.location[0]} ${containment.location[1]})`, detectionDateTime: new Date(windowEnd).toISOString(), }; if (!isRecovered) { diff --git a/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/lib/transform_results.ts b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/lib/transform_results.ts index fed5a352673580..6b457575b40292 100644 --- a/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/lib/transform_results.ts +++ b/x-pack/plugins/stack_alerts/server/rule_types/geo_containment/lib/transform_results.ts @@ -35,7 +35,8 @@ export function transformResults( // vs a huge CPU penetatily for all kibana nodes for the rest of the time // Algorithm optimized for the more common use case where all Kibana nodes are running updated version location: [0, 0], - locationWkt: entitySplitBuckets[i].entityHits?.hits?.hits?.[0]?.fields?.[geoField]?.[0] ?? '', + locationWkt: + entitySplitBuckets[i].entityHits?.hits?.hits?.[0]?.fields?.[geoField]?.[0] ?? '', shapeLocationId: boundaryId, dateInShape: entitySplitBuckets[i].entityHits?.hits?.hits?.[0]?.fields?.[dateField]?.[0] ?? null,