From 391caaceaf680fa743c13bdad19d7ddbd8a10a23 Mon Sep 17 00:00:00 2001 From: eric-forte-elastic Date: Fri, 25 Jul 2025 14:45:10 -0400 Subject: [PATCH] Fix logging typo --- detection_rules/kbwrap.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/detection_rules/kbwrap.py b/detection_rules/kbwrap.py index 6f5c9a156ed..73732869d06 100644 --- a/detection_rules/kbwrap.py +++ b/detection_rules/kbwrap.py @@ -322,6 +322,10 @@ def kibana_export_rules( # noqa: PLR0912, PLR0913, PLR0915 return [] rules_results = results # type: ignore[reportUnknownVariableType] + if (custom_rules_only or export_query) and "exported_rules_count" in results[-1]: # type: ignore[reportUnknownMemberType] + # Kibana returns a summary message if a query is provided, so we need to filter out the summary + rules_results = rules_results[:-1] # type: ignore[reportUnknownVariableType] + results = results[:-1] # type: ignore[reportUnknownVariableType] action_connector_results = [] exception_results = [] if kibana_include_details: