Detection Rules
A detection rule is a query that runs continuously on new logs as they arrive in Scanner. You can create create, read, update, and delete detection rules with the Scanner API.
Create a new detection rule
Name
Type
Description
curl $API_BASE/v1/detection_rule \
-H "Authorization: Bearer $SCANNER_API_KEY" \
-H "Content-Type: application/json" \
-X POST \
-d '{
"tenant_id": "00000000-0000-0000-0000-000000000000",
"name": "Errors",
"description": "Errors in application logs",
"time_range_s": 300,
"run_frequency_s": 300,
"enabled": true,
"severity": "Informational",
"query_text": "error | count | where @q.count > 100",
"tags": ["scanner.error"],
"event_sink_ids": []
}'List detection rules
Name
Type
Description
Get a detection rule
Update a detection rule
Name
Type
Description
Delete a detection rule
Detection severity
Last updated
Was this helpful?