From 11288ad801313a5f1c360266dfeb010e6168474a Mon Sep 17 00:00:00 2001 From: DerekRushton Date: Wed, 28 Aug 2024 09:42:27 -0300 Subject: [PATCH] Warning added for unmapped from_stix fields. 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):