diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts b/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts index 02ac19e7b6f1e..2b57d2b057b02 100644 --- a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts +++ b/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/es_query_builder.ts @@ -191,12 +191,18 @@ export async function executeEsQueryFactory( }, }; + + console.log('************************'); + console.log(JSON.stringify(esQuery.body)); + let esResult: SearchResponse | undefined; try { esResult = await callCluster('search', esQuery); } catch (err) { log.warn(`${err.message}`); } + console.log('_______________________'); + console.log(JSON.stringify(esResult)); return esResult; }; } diff --git a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/geo_containment.ts b/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/geo_containment.ts index 55b969436cfb0..a36cc8f7ea6a3 100644 --- a/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/geo_containment.ts +++ b/x-pack/plugins/stack_alerts/server/alert_types/geo_containment/geo_containment.ts @@ -165,23 +165,22 @@ export const getGeoContainmentExecutor = (log: Logger) => ); // Cycle through instances that received no updates and keep active - const activeAlertsList = state.activeAlertsList || {}; - - _.forEach(activeAlertsList, (val, key) => { - if (!currLocationMap.has(key)) { - const containingBoundaryName = - shapesIdsNamesMap[val.containingBoundaryId] || val.containingBoundaryId; - const alertInstanceId = `${val.entityName}-${containingBoundaryName}`; - services.alertInstanceFactory(alertInstanceId).scheduleActions(ActionGroupId, val); - } - }); - + // const activeAlertsList = state.activeAlertsList || {}; + // _.forEach(activeAlertsList, (val, key) => { + // if (!currLocationMap.has(key)) { + // const containingBoundaryName = + // shapesIdsNamesMap[val.containingBoundaryId] || val.containingBoundaryId; + // const alertInstanceId = `${key}-${containingBoundaryName}`; + // services.alertInstanceFactory(alertInstanceId).scheduleActions(ActionGroupId, val); + // } + // }); + // // Cycle through new alert statuses and set active currLocationMap.forEach(({ location, shapeLocationId, dateInShape, docId }, entityName) => { const containingBoundaryName = shapesIdsNamesMap[shapeLocationId] || shapeLocationId; const context = { entityId: entityName, - entityDateTime: new Date(dateInShape).getTime(), + entityDateTime: dateInShape, entityDocumentId: docId, detectionDateTime: new Date(currIntervalEndTime).getTime(), entityLocation: `POINT (${location[0]} ${location[1]})`, @@ -190,15 +189,15 @@ export const getGeoContainmentExecutor = (log: Logger) => }; const alertInstanceId = `${entityName}-${containingBoundaryName}`; if (shapeLocationId !== OTHER_CATEGORY) { - activeAlertsList[entityName] = context; + // activeAlertsList[entityName] = context; services.alertInstanceFactory(alertInstanceId).scheduleActions(ActionGroupId, context); } else { - delete activeAlertsList[entityName]; + // delete activeAlertsList[entityName]; } }); return { - activeAlertsList, + // activeAlertsList, shapesFilters, shapesIdsNamesMap, };