From 318ab3ffa072ce6485717c7c01be30be0cc520f3 Mon Sep 17 00:00:00 2001 From: shashank-elastic <91139415+shashank-elastic@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:18:05 +0530 Subject: [PATCH] Enhance Readability of KQL validation check failures (#4329) --- detection_rules/rule_validators.py | 4 +++- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/detection_rules/rule_validators.py b/detection_rules/rule_validators.py index 3ce6e4f35..5fe957ec1 100644 --- a/detection_rules/rule_validators.py +++ b/detection_rules/rule_validators.py @@ -158,7 +158,9 @@ class KQLValidator(QueryValidator): # auto add the field and re-validate self.auto_add_field(validation_checks["stack"], data.index_or_dataview[0]) else: - raise ValueError(f"Error in both stack and integrations checks: {validation_checks}") + click.echo(f"Stack Error Trace: {validation_checks["stack"]}") + click.echo(f"Integrations Error Trace: {validation_checks["integrations"]}") + raise ValueError("Error in both stack and integrations checks") else: break diff --git a/pyproject.toml b/pyproject.toml index 1cc37a999..6e5a3c4de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "detection_rules" -version = "0.3.8" +version = "0.3.9" description = "Detection Rules is the home for rules used by Elastic Security. This repository is used for the development, maintenance, testing, validation, and release of rules for Elastic Security’s Detection Engine." readme = "README.md" requires-python = ">=3.12"