Event contract
Fields the query expects
| Field | Type | Why it exists |
|---|---|---|
| timestamp_utc | Timestamp | Authentication outcome time. |
| actor_id | Utf8 | Privacy-safe actor identifier. |
| network_bucket | Utf8 | Approved coarse network or risk bucket. |
| authentication_method | Utf8 | Controlled authentication method. |
| outcome | Utf8 | success or failed. |
Copy the query
SELECT
date_trunc('hour', timestamp_utc) AS hour,
network_bucket,
authentication_method,
COUNT(*) AS attempts,
SUM(CASE WHEN outcome = 'failed' THEN 1 ELSE 0 END) AS failures,
COUNT(DISTINCT actor_id) AS targeted_actors
FROM authentication_events
WHERE timestamp_utc >= now() - INTERVAL '24 hours'
GROUP BY date_trunc('hour', timestamp_utc), network_bucket, authentication_method
HAVING SUM(CASE WHEN outcome = 'failed' THEN 1 ELSE 0 END) >= 20
ORDER BY failures DESC, targeted_actors DESC;This read-only query is planned and executed against an empty typed table with Apache DataFusion 45.2.0. The deterministic sample output is synthetic and reviewed separately; validate field types, thresholds, and business definitions against your own data. Read the testing methodology.
Query result
Authentication failures by network bucket
The proxy-risk bucket targets far more identities and has the largest failure volume.
| hour | network_bucket | authentication_method | attempts | failures | targeted_actors |
|---|---|---|---|---|---|
| 2026-07-28 18:00 | risk-proxy | password | 480 | 451 | 206 |
| 2026-07-28 19:00 | unknown-datacenter | password | 122 | 104 | 11 |
Synthetic example output. Run the query against your own event schema and thresholds before using it for operational decisions.
Reproduce the example
Download the public fixture
The JSON bundle includes the typed event contract, illustrative input rows, exact SQL, expected output, review notes, and engine version. The CSV contains the displayed result.
How the SQL works
- 1Hour, network bucket, and method create an investigation unit.
- 2Distinct actors separates broad spraying from repeated attempts against one identity.
- 3The threshold is a review candidate, not an automatic proof of abuse.
Edge cases to decide
- Privacy and security owners must approve network bucketing.
- Shared corporate networks can create benign concentration.
- Do not log passwords, tokens, cookies, or full IP addresses.
Recommended dashboard
- Bars: failures by network bucket
- Trend: targeted_actors by hour
- Table: reviewed bursts and response outcome
Alert guidance
Route high-volume bursts to the security response process only after volume and actor thresholds are approved.
Read alert setupPut the recipe to work
Related instrumentation and guides
Continue the analysis
Analyze Authentication Failure Rate
Measure authentication failures by method and reason while keeping traffic volume and affected identities visible.
Open recipeAudit Privileged Actions with SQL
Summarize sensitive administrative actions, denied attempts, and review-required outcomes without collecting raw secrets or resource contents.
Open recipeAnalyze Access-Policy Denials
Rank denied actions by policy, resource class, actor role, and affected identities.
Open recipeRun it on real events
Create a table, adapt the fields, and save the result
Start free, send structured events, and use the query result as a chart, shared dashboard widget, or alert input.