From de7ed6de4f8a2558f920f45b3f5db07ca9e13033 Mon Sep 17 00:00:00 2001 From: DerekRushton <41486484+DerekRushton@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:08:16 -0300 Subject: [PATCH] Warning added for unmapped from_stix fields. (#1729) Signed-off-by: DerekRushton --- .../modules/base/stix_translation/base_query_translator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stix_shifter_utils/modules/base/stix_translation/base_query_translator.py b/stix_shifter_utils/modules/base/stix_translation/base_query_translator.py index 172bf84e7..538c7612c 100644 --- a/stix_shifter_utils/modules/base/stix_translation/base_query_translator.py +++ b/stix_shifter_utils/modules/base/stix_translation/base_query_translator.py @@ -114,8 +114,10 @@ def transform_query(self, data): unmapped_operator = stripped_parsing.get('unmapped_operator') if unmapped_stix: unmapped_stix_collection.extend(unmapped_stix) + self.logger.warn(f"The following STIX fields are not supported : {set(unmapped_stix_collection)} with dialect {self.dialect}. The request will ignore those fields. This can result in results that do not match the request.") if unmapped_operator: unmapped_operator_collection.extend(unmapped_operator) + self.logger.warn(f"The following STIX operators are not supported : {set(unmapped_operator_collection)} with dialect {self.dialect}. The request will ignore those fields. This can result in results that do not match the request.") if antlr_parsing: translated_queries = self.transform_antlr(data, antlr_parsing) if isinstance(translated_queries, str):