diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/eql_query_edit/eql_query_edit.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/eql_query_edit/eql_query_edit.tsx index 2a64f38b51b8f..c444f12915836 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/eql_query_edit/eql_query_edit.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/eql_query_edit/eql_query_edit.tsx @@ -23,6 +23,7 @@ import type { FieldValueQueryBar } from '../query_bar'; interface EqlQueryEditProps { path: string; + fieldsToValidateOnChange?: string | string[]; eqlFieldsComboBoxOptions?: EqlFieldsComboBoxOptions; eqlOptions?: EqlOptions; showEqlSizeOption?: boolean; @@ -38,6 +39,7 @@ interface EqlQueryEditProps { export function EqlQueryEdit({ path, + fieldsToValidateOnChange, eqlFieldsComboBoxOptions, eqlOptions, showEqlSizeOption = false, @@ -81,6 +83,9 @@ export function EqlQueryEdit({ const fieldConfig: FieldConfig = useMemo( () => ({ label: i18n.EQL_QUERY_BAR_LABEL, + fieldsToValidateOnChange: fieldsToValidateOnChange + ? [path, fieldsToValidateOnChange].flat() + : undefined, validations: [ ...(required ? [ @@ -107,7 +112,7 @@ export function EqlQueryEdit({ }, ], }), - [required, dataView.id, dataView.title, eqlOptions] + [required, dataView.id, dataView.title, eqlOptions, path, fieldsToValidateOnChange] ); return ( diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx index a5636f9bc77f2..e83643384f6a0 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx @@ -91,7 +91,10 @@ import { useAlertSuppression } from '../../../rule_management/logic/use_alert_su import { AiAssistant } from '../ai_assistant'; import { RelatedIntegrations } from '../../../rule_creation/components/related_integrations'; import { useMLRuleConfig } from '../../../../common/components/ml/hooks/use_ml_rule_config'; -import { AlertSuppressionEdit } from '../../../rule_creation/components/alert_suppression_edit'; +import { + ALERT_SUPPRESSION_FIELDS_FIELD_NAME, + AlertSuppressionEdit, +} from '../../../rule_creation/components/alert_suppression_edit'; import { ThresholdAlertSuppressionEdit } from '../../../rule_creation/components/threshold_alert_suppression_edit'; import { usePersistentAlertSuppressionState } from './use_persistent_alert_suppression_state'; @@ -797,6 +800,7 @@ const StepDefineRuleComponent: FC = ({