Skip to content

Commit eeec54d

Browse files
Add additional unit test for schema conflicts
1 parent 5e35f88 commit eeec54d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_rules_remote.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,20 @@ def test_esql_filtered_keep(self):
218218
"""
219219
with pytest.raises(EsqlSchemaError):
220220
_ = RuleCollection().load_dict(production_rule)
221+
222+
def test_esql_non_ecs_schema_conflict_resolution(self):
223+
"""Test an ESQL rule that has a known conflict between non_ecs and integrations for correct handling."""
224+
file_path = get_path(["tests", "data", "command_control_dummy_production_rule.toml"])
225+
original_production_rule = load_rule_contents(file_path)
226+
production_rule = deepcopy(original_production_rule)[0]
227+
production_rule["metadata"]["integration"] = ["azure", "o365"]
228+
production_rule["rule"]["query"] = """
229+
from logs-azure.signinlogs-* metadata _id, _version, _index
230+
| where @timestamp > now() - 30 minutes
231+
and event.dataset in ("azure.signinlogs")
232+
and event.outcome == "success"
233+
and azure.signinlogs.properties.user_id is not null
234+
| keep
235+
event.outcome
236+
"""
237+
_ = RuleCollection().load_dict(production_rule)

0 commit comments

Comments
 (0)