From 7ef80cf3f0426a8ef63469ee0b9b5449f1a519e0 Mon Sep 17 00:00:00 2001 From: semd Date: Thu, 12 Aug 2021 19:32:49 +0200 Subject: [PATCH] clean up and fixes --- .../server/routes/bulk_update_alerts.ts | 4 ++-- ..._update_old_security_solution_alert_by_query.sh | 14 +------------- .../public/components/t_grid/integrated/index.tsx | 13 ------------- .../public/container/use_update_alerts.ts | 4 +--- 4 files changed, 4 insertions(+), 31 deletions(-) diff --git a/x-pack/plugins/rule_registry/server/routes/bulk_update_alerts.ts b/x-pack/plugins/rule_registry/server/routes/bulk_update_alerts.ts index 9a29774219270..3bab930da08b9 100644 --- a/x-pack/plugins/rule_registry/server/routes/bulk_update_alerts.ts +++ b/x-pack/plugins/rule_registry/server/routes/bulk_update_alerts.ts @@ -22,13 +22,13 @@ export const bulkUpdateAlertsRoute = (router: IRouter) body: buildRouteValidation( t.union([ t.strict({ - status: t.union([t.literal('open'), t.literal('closed')]), + status: t.union([t.literal('open'), t.literal('closed'), t.literal('in-progress')]), index: t.string, ids: t.array(t.string), query: t.undefined, }), t.strict({ - status: t.union([t.literal('open'), t.literal('closed')]), + status: t.union([t.literal('open'), t.literal('closed'), t.literal('in-progress')]), index: t.string, ids: t.undefined, query: t.union([t.object, t.string]), diff --git a/x-pack/plugins/rule_registry/server/scripts/bulk_update_old_security_solution_alert_by_query.sh b/x-pack/plugins/rule_registry/server/scripts/bulk_update_old_security_solution_alert_by_query.sh index b7642094fd2e2..8725e791d8efa 100755 --- a/x-pack/plugins/rule_registry/server/scripts/bulk_update_old_security_solution_alert_by_query.sh +++ b/x-pack/plugins/rule_registry/server/scripts/bulk_update_old_security_solution_alert_by_query.sh @@ -25,16 +25,4 @@ curl -s -k \ -H 'kbn-xsrf: 123' \ -u hunter:changeme \ -X POST ${KIBANA_URL}${SPACE_URL}/internal/rac/alerts/bulk_update \ - -d "{\"ids\": [\"7e5bf32b8aa1a96b835200d8a6aad39079f03257129ad238a828152884690c86\"], \"status\":\"$STATUS\", \"index\":\".siem-signals-devin-hurley-default\"}" | jq . - -# -d "{\"query\": {\"bool\": { -# \"filter\": { -# \"terms\": { -# \"_id\": [ \"7e5bf32b8aa1a96b835200d8a6aad39079f03257129ad238a828152884690c86\" -# ] -# } -# } -# }}, \"status\":\"$STATUS\", \"index\":\".siem-signals-devin-hurley-default\"}" | jq . - - -# 824ec1a1c9a0fcded6063e88353b828e414149b37f6d7cbe47a038d08aaa3285 \ No newline at end of file +-d "{\"query\": \"$QUERY\", \"status\":\"$STATUS\", \"index\":\".siem-signals*\"}" | jq . diff --git a/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx b/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx index fb3b7db4dab84..7dc632c219bd8 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx +++ b/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx @@ -263,18 +263,6 @@ const TGridIntegratedComponent: React.FC = ({ }); const filterQuery = useMemo(() => { - console.log('getCombinedFilterQuery', { - config: esQuery.getEsQueryConfig(uiSettings), - dataProviders, - indexPattern, - browserFields, - filters, - kqlQuery: query, - kqlMode, - isEventViewer: true, - from: start, - to: end, - }); return getCombinedFilterQuery({ config: esQuery.getEsQueryConfig(uiSettings), dataProviders, @@ -288,7 +276,6 @@ const TGridIntegratedComponent: React.FC = ({ to: end, }); }, [uiSettings, dataProviders, indexPattern, browserFields, filters, start, end, query, kqlMode]); - console.log('getCombinedFilterQuery', JSON.parse(filterQuery)); const totalCountMinusDeleted = useMemo( () => (totalCount > 0 ? totalCount - deletedEventIds.length : 0), diff --git a/x-pack/plugins/timelines/public/container/use_update_alerts.ts b/x-pack/plugins/timelines/public/container/use_update_alerts.ts index a45bd28b848c0..6b7c660a734eb 100644 --- a/x-pack/plugins/timelines/public/container/use_update_alerts.ts +++ b/x-pack/plugins/timelines/public/container/use_update_alerts.ts @@ -32,9 +32,7 @@ export const useUpdateAlertsStatus = (): { } => { const { http } = useKibana().services; return { - updateAlertStatus: async ({ status: alertStatus, index, ids, query }) => { - const status: string = alertStatus === 'in-progress' ? 'acknowledged' : alertStatus; - + updateAlertStatus: async ({ status, index, ids, query }) => { const { body } = await http!.fetch(RAC_ALERTS_BULK_UPDATE_URL, { method: 'POST', body: JSON.stringify({ index, status, ...(query ? { query } : { ids }) }),