From c99c74f508c2cc2e21d103f2ccb49d7599b63e6a Mon Sep 17 00:00:00 2001 From: Sergei Yakima Date: Thu, 22 Oct 2026 17:42:54 +0300 Subject: [PATCH 1/7] exclude severity & subtype 'all' value from constraint as it does no affect query construction --- .../Integrations/CortexDataLake/CortexDataLake.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Packs/CortexDataLake/Integrations/CortexDataLake/CortexDataLake.py b/Packs/CortexDataLake/Integrations/CortexDataLake/CortexDataLake.py index 6f5c7c159c20..7e0bab067f90 100644 --- a/Packs/CortexDataLake/Integrations/CortexDataLake/CortexDataLake.py +++ b/Packs/CortexDataLake/Integrations/CortexDataLake/CortexDataLake.py @@ -1320,17 +1320,20 @@ def prepare_fetch_incidents_query( Returns: SQL query that matches the arguments """ - if fetch_filter and (fetch_subtype or fetch_severity): + # "all" adds no condition to the query, so it does not conflict with a fetch filter. + has_subtype_restriction = bool(fetch_subtype) and "all" not in fetch_subtype + has_severity_restriction = bool(fetch_severity) and "all" not in fetch_severity + if fetch_filter and (has_subtype_restriction or has_severity_restriction): raise DemistoException("Fetch Filter parameter cannot be used with Subtype/Severity parameters.") query = f"SELECT {fetch_fields} FROM `{fetch_table}` " # guardrails-disable-line # noqa: S608 time_filter = "event_time" if "log" in fetch_table else "time_generated" query += f'WHERE {time_filter} Between TIMESTAMP("{fetch_timestamp}") AND CURRENT_TIMESTAMP' if fetch_filter: query += f" AND {fetch_filter}" - if fetch_subtype and "all" not in fetch_subtype: + if has_subtype_restriction: sub_types = [f'sub_type.value = "{sub_type}"' for sub_type in fetch_subtype] query += f' AND ({" OR ".join(sub_types)})' - if fetch_severity and "all" not in fetch_severity: + if has_severity_restriction: severities = [f'vendor_severity.value = "{severity}"' for severity in fetch_severity] query += f' AND ({" OR ".join(severities)})' query += f" ORDER BY {time_filter} ASC LIMIT {fetch_limit}" From 1a857cd8b5bcd41cbe73b78dd6996838fd0a076b Mon Sep 17 00:00:00 2001 From: Sergei Yakima Date: Thu, 22 Oct 2026 17:43:41 +0300 Subject: [PATCH 2/7] update documentation --- .../Integrations/CortexDataLake/CortexDataLake.yml | 2 +- .../Integrations/CortexDataLake/CortexDataLake_description.md | 2 ++ Packs/CortexDataLake/Integrations/CortexDataLake/README.md | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Packs/CortexDataLake/Integrations/CortexDataLake/CortexDataLake.yml b/Packs/CortexDataLake/Integrations/CortexDataLake/CortexDataLake.yml index d7f75c2935b5..6de7037e99f2 100644 --- a/Packs/CortexDataLake/Integrations/CortexDataLake/CortexDataLake.yml +++ b/Packs/CortexDataLake/Integrations/CortexDataLake/CortexDataLake.yml @@ -142,7 +142,7 @@ configuration: type: 12 required: false section: Collect -- additionalinfo: 'Filter the fetched incidents according to the given query. Query example: "source_ip.value LIKE `192.168.1.*` AND dst = `192.168.1.12`" Note: Can not be used in combination with `Severity` and `Subtype` parameters.' +- additionalinfo: 'Filter the fetched incidents according to the given query. Query example: "source_ip.value LIKE `192.168.1.*` AND dst = `192.168.1.12`" Note: Can not be used in combination with specific `Severity` and `Subtype` values. Leave them empty or set to "all".' display: Fetch Filter name: filter_query type: 12 diff --git a/Packs/CortexDataLake/Integrations/CortexDataLake/CortexDataLake_description.md b/Packs/CortexDataLake/Integrations/CortexDataLake/CortexDataLake_description.md index 1061f0205aa2..2c8ce8608d04 100644 --- a/Packs/CortexDataLake/Integrations/CortexDataLake/CortexDataLake_description.md +++ b/Packs/CortexDataLake/Integrations/CortexDataLake/CortexDataLake_description.md @@ -30,6 +30,8 @@ This integration was tested with version 2 of Strata Logging Service XSOAR Conne * **insecure**: Trust any certificate (not secure). * **Fetch incidents**: Whether to fetch incidents. * **First fetch time**: First fetch time (\ \