fix(crowdstrike): say what an empty alert search matched (1.6.1)

search_detections and search_ngsiem_detections now return a query block
(FQL sent, Falcon's total, errors) next to resources, so an empty run can
be told apart from a wrong region or an API client that sees no alerts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-15 08:09:39 +00:00
parent 0444e120fa
commit f34c87f0c8
3 changed files with 18 additions and 2 deletions
@@ -51,6 +51,14 @@ def main():
result = call("POST", "/alerts/entities/alerts/v2", tok, body={"composite_ids": ids})
else:
result = {"resources": []}
# An empty page says nothing on its own: keep what the query answered — the
# FQL actually sent, Falcon's total for it and any errors — so a run with no
# alerts reads as "matched nothing" rather than as a silent failure.
result["query"] = {
"filter": fql,
"total": ((found.get("meta") or {}).get("pagination") or {}).get("total"),
"errors": found.get("errors") or [],
}
print(json.dumps(result))
@@ -53,6 +53,14 @@ def main():
result = call("POST", "/alerts/entities/alerts/v2", tok, body={"composite_ids": ids})
else:
result = {"resources": []}
# An empty page says nothing on its own: keep what the query answered — the
# FQL actually sent, Falcon's total for it and any errors — so a run with no
# alerts reads as "matched nothing" rather than as a silent failure.
result["query"] = {
"filter": fql,
"total": ((found.get("meta") or {}).get("pagination") or {}).get("total"),
"errors": found.get("errors") or [],
}
print(json.dumps(result))