Skip to content

Commit

Permalink
clean up and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
semd committed Aug 12, 2021
1 parent 120029e commit 7ef80cf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ export const bulkUpdateAlertsRoute = (router: IRouter<RacRequestHandlerContext>)
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]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
-d "{\"query\": \"$QUERY\", \"status\":\"$STATUS\", \"index\":\".siem-signals*\"}" | jq .
Original file line number Diff line number Diff line change
Expand Up @@ -263,18 +263,6 @@ const TGridIntegratedComponent: React.FC<TGridIntegratedProps> = ({
});

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,
Expand All @@ -288,7 +276,6 @@ const TGridIntegratedComponent: React.FC<TGridIntegratedProps> = ({
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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) }),
Expand Down

0 comments on commit 7ef80cf

Please sign in to comment.