Skip to content

Commit 318ab3f

Browse files
Enhance Readability of KQL validation check failures (#4329)
1 parent 52db5e0 commit 318ab3f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

detection_rules/rule_validators.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ def validate(self, data: QueryRuleData, meta: RuleMeta, max_attempts: int = 10)
158158
# auto add the field and re-validate
159159
self.auto_add_field(validation_checks["stack"], data.index_or_dataview[0])
160160
else:
161-
raise ValueError(f"Error in both stack and integrations checks: {validation_checks}")
161+
click.echo(f"Stack Error Trace: {validation_checks["stack"]}")
162+
click.echo(f"Integrations Error Trace: {validation_checks["integrations"]}")
163+
raise ValueError("Error in both stack and integrations checks")
162164

163165
else:
164166
break

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "detection_rules"
3-
version = "0.3.8"
3+
version = "0.3.9"
44
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."
55
readme = "README.md"
66
requires-python = ">=3.12"

0 commit comments

Comments
 (0)