TH2.2 The make-series Operator
From events to time series
A sign-in log records that j.morrison signed in at 14:32, 14:47, and 15:03. Those are three events. A time series representation of the same data — with 1-hour bins — says: “hour 14 had 2 sign-ins, hour 15 had 1 sign-in, hour 16 had 0, hour 17 had 0…” The time series includes the zeros. The zeros are the hours where nothing happened — and in hunting, the change from “nothing happening” to “something happening” (or vice versa) is often the signal.
make-series is the KQL operator that performs this transformation.
Basic make-series for hunting
| |
The critical parameters:
step — the bin size. This determines the granularity of the time series. step 1d produces daily bins. step 1h produces hourly bins. step 5m produces 5-minute bins.
Smaller bins reveal finer-grained patterns but produce longer arrays and more noise. Larger bins smooth out noise but may hide short-duration anomalies. The correct bin size depends on the technique:
- Authentication anomalies (TH4): 1-hour bins. AiTM token replay produces bursts of sign-ins within hours. Daily bins would average out the burst.
- Data exfiltration (TH8): 1-day bins. Exfiltration typically sustains over hours or days. Hourly bins produce noise from legitimate work patterns.
- C2 beaconing (TH12): 5-minute or 15-minute bins. Beacon intervals are measured in minutes. Hourly bins would miss the periodicity.
from and to — the time boundaries. Always specify both. Without them, make-series infers boundaries from the data — which means different users may have different time ranges, making comparison impossible.
by — the entity dimension. by UserPrincipalName creates a separate time series per user. by DeviceName creates one per device. by IPAddress creates one per IP. The entity dimension determines what you are profiling.
Fill strategies
By default, make-series fills gaps with zero. In most hunting applications, this is correct — a user who did not sign in on Tuesday has zero sign-ins for that day.
For metrics where zero is not the right default (e.g., session duration, where zero is meaningless), use default=:
| |
make-series for population profiling
Instead of per-entity series, create a single series for the entire population to understand organizational patterns:
| |
| |
Figure TH2.2 — Bin size selection for make-series. The technique being hunted determines the appropriate granularity. Each campaign module specifies its bin size.
Try it yourself
Exercise: Build your first time series
Run the organization-wide hourly sign-in query (168 values for one week). The result is an array. To visualize it, add `| render timechart` at the end of the query.
Observe: can you see the weekday/weekend pattern? Can you identify normal work hours versus off-hours? Is there a baseline overnight volume (service accounts, automated systems)?
Then run the per-user daily query for the top 5 users by sign-in volume. Compare their patterns. Do they follow the organizational pattern, or do some users have anomalous schedules?
This visual inspection is the foundation for the automated anomaly detection in TH2.3.
The myth: Meaningful time series analysis requires Python, R, or a dedicated analytics platform. KQL is a query language, not an analytics tool.
The reality: KQL’s make-series family of operators provides built-in time series construction, decomposition, anomaly detection, forecasting, and smoothing — all within the Sentinel or Advanced Hunting query engine. No external tools required. The series_decompose_anomalies() function (TH2.3) is a production-grade anomaly detection algorithm that runs directly in KQL. For most hunting applications, KQL’s built-in time series capabilities are sufficient. Python (via Sentinel notebooks) is valuable for complex multi-variate analysis, but the standard hunting patterns in this course use KQL exclusively.
Extend this operator
make-series supports multiple aggregations in a single call: `make-series Count=count(), AvgDuration=avg(Duration), UniqueIPs=dcount(IPAddress)`. This produces parallel time series arrays that can be analyzed together — for example, detecting when both sign-in count and IP diversity increase simultaneously (stronger AiTM indicator than either alone). TH4 uses this multi-metric pattern.
References Used in This Subsection
- Microsoft. “KQL make-series Operator.” Microsoft Learn. https://learn.microsoft.com/en-us/kusto/query/make-series-operator
- Course cross-references: TH4 (hourly auth series), TH8 (daily download series), TH12 (minute-level beacon series)
You're reading the free modules of this course
The full course continues with advanced topics, production detection rules, worked investigation scenarios, and deployable artifacts. Premium subscribers get access to all courses.