diff --git a/public/pages/Correlations/containers/CorrelationRuleFormModel.ts b/public/pages/Correlations/containers/CorrelationRuleFormModel.ts index 6bad7ef45..775b07523 100644 --- a/public/pages/Correlations/containers/CorrelationRuleFormModel.ts +++ b/public/pages/Correlations/containers/CorrelationRuleFormModel.ts @@ -7,7 +7,7 @@ import { CorrelationRuleModel } from '../../../../types'; export const correlationRuleStateDefaultValue: CorrelationRuleModel = { name: '', - time_window: 60000, + time_window: 300000, queries: [ { logType: '', diff --git a/public/pages/Correlations/containers/CreateCorrelationRule.tsx b/public/pages/Correlations/containers/CreateCorrelationRule.tsx index b077d506f..f6823a7dc 100644 --- a/public/pages/Correlations/containers/CreateCorrelationRule.tsx +++ b/public/pages/Correlations/containers/CreateCorrelationRule.tsx @@ -702,15 +702,17 @@ export const CreateCorrelationRule: React.FC = ( errors.time_window = 'Invalid time window.'; } - values.queries.forEach((query, idx) => { - if (!query.field) { - if (!errors.queries) { - errors.queries = Array(values.queries.length).fill(null); - } + if (groupByEnabled) { + values.queries.forEach((query, idx) => { + if (!query.field) { + if (!errors.queries) { + errors.queries = Array(values.queries.length).fill(null); + } - (errors.queries as Array<{ field: string }>)[idx] = { field: 'Field is required.' }; - } - }); + (errors.queries as Array<{ field: string }>)[idx] = { field: 'Field is required.' }; + } + }); + } return errors; }}