mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Security Solution] [Platform] Fixes the alert context menu option to add rule exception (#138291)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
27162e0802
commit
5155d6a5b8
3 changed files with 14 additions and 1 deletions
|
@ -74,5 +74,7 @@ export interface Ecs {
|
|||
Target?: Target;
|
||||
dll?: DllEcs;
|
||||
'kibana.alert.workflow_status'?: 'open' | 'acknowledged' | 'in-progress' | 'closed';
|
||||
'kibana.alert.rule.parameters'?: { index: string[] };
|
||||
// I believe these parameters are all snake cased to correspond with how they are sent "over the wire" as request / response
|
||||
// Not representative of the parsed types that are camel cased.
|
||||
'kibana.alert.rule.parameters'?: { index: string[]; data_view_id?: string };
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ export interface RuleEcs {
|
|||
from?: string[];
|
||||
immutable?: boolean[];
|
||||
index?: string[];
|
||||
data_view_id?: string;
|
||||
interval?: string[];
|
||||
language?: string[];
|
||||
query?: string[];
|
||||
|
|
|
@ -344,6 +344,15 @@ export const AddExceptionFlyoutWrapper: React.FC<AddExceptionFlyoutWrapperProps>
|
|||
return ruleIndices;
|
||||
}, [enrichedAlert, ruleIndices]);
|
||||
|
||||
const memoDataViewId = useMemo(() => {
|
||||
if (
|
||||
enrichedAlert != null &&
|
||||
enrichedAlert['kibana.alert.rule.parameters']?.data_view_id != null
|
||||
) {
|
||||
return enrichedAlert['kibana.alert.rule.parameters'].data_view_id;
|
||||
}
|
||||
}, [enrichedAlert]);
|
||||
|
||||
const isLoading = isLoadingAlertData && isSignalIndexLoading;
|
||||
|
||||
return (
|
||||
|
@ -351,6 +360,7 @@ export const AddExceptionFlyoutWrapper: React.FC<AddExceptionFlyoutWrapperProps>
|
|||
ruleName={ruleName}
|
||||
ruleId={ruleId}
|
||||
ruleIndices={useRuleIndices}
|
||||
dataViewId={memoDataViewId}
|
||||
exceptionListType={exceptionListType}
|
||||
alertData={enrichedAlert}
|
||||
isAlertDataLoading={isLoading}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue