From c49ad60714131eeacde2b9b23eab12f0b320b94c Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 16:30:04 -0800 Subject: [PATCH] added check for threat intel (#849) (#869) (cherry picked from commit 9d5613884907fcaa93f5757e46abffb941c2e558) Signed-off-by: Amardeepsingh Siglani Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../containers/ConfigureFieldMapping.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/public/pages/CreateDetector/components/ConfigureFieldMapping/containers/ConfigureFieldMapping.tsx b/public/pages/CreateDetector/components/ConfigureFieldMapping/containers/ConfigureFieldMapping.tsx index 4561009c3..16a9e178b 100644 --- a/public/pages/CreateDetector/components/ConfigureFieldMapping/containers/ConfigureFieldMapping.tsx +++ b/public/pages/CreateDetector/components/ConfigureFieldMapping/containers/ConfigureFieldMapping.tsx @@ -276,9 +276,14 @@ export default class ConfigureFieldMapping extends Component< mappingsView.response.properties[ruleFieldName].path; }); let threatIntelFeedFields = new Set(); - mappingsView.response.threat_intel_field_aliases?.forEach(({ fields }) => { - fields.forEach((field) => threatIntelFeedFields.add(field)); - }); + + // Only if threat_intel is enabled, we want to show the relevant fields for mapping + if (this.state.detector.threat_intel_enabled) { + mappingsView.response.threat_intel_field_aliases?.forEach(({ fields }) => { + fields.forEach((field) => threatIntelFeedFields.add(field)); + }); + } + mappingsView.response.unmapped_field_aliases?.forEach((ruleFieldName) => { if ( !ruleFieldsForEnabledRules.has(ruleFieldName) &&