Skip to content

Response, New York. Noah Park: Check Point Patches Actively Exploited Management Server Path Traversal. Detection, Dallas. Ava Okello: Report Finds Nearly Half of Deployed Detections Need Attention Before SOCs Can Trust Them.

SOCtember

Always First. Fast SOC News.

Microsoft Learn diagram from Handle ingestion delay in scheduled analytics rules, showing an event generated inside the first five-minute look-back window but ingested two minutes later, after the first run, so the second run's time filter drops it.
Screenshot: Microsoft Learn, Handle ingestion delay in scheduled analytics rules, Microsoft (fair use).

Tools

Did You Know: A Microsoft Sentinel Scheduled Rule Can Miss an Event That Arrives Late, Because It Searches by When the Event Happened, Not When It Landed

A scheduled analytics rule in Microsoft Sentinel looks back over a window of event time. Microsoft's own documentation shows how a log that is ingested two minutes late can slip between two runs and never raise an alert, and how the ingestion_time() function closes the gap.

James Whitford, ToolsAustin3 min read

AUSTIN - A scheduled analytics rule in Microsoft Sentinel asks the same question every time it runs: what happened in the last few minutes? The catch is in how it answers. The rule's look-back window is measured against TimeGenerated, the time an event was created at its source, but the event can only be found once it has been ingested into the workspace. When those two times drift apart, an event can fall through the gap.

Microsoft walks through the failure in its Sentinel documentation on ingestion delay. A rule runs every five minutes and looks back five minutes. An event is generated inside the first window but ingested two minutes later, after the first run has finished. On the next run the event is in the workspace, but its timestamp is now more than five minutes old, so the time filter removes it. "In this case, the rule does not fire an alert," the page says.

Microsoft Learn note in Scheduled analytics rules in Microsoft Sentinel stating that Sentinel runs scheduled analytics rules on a five-minute delay from their scheduled time to account for ingestion latency.
Screenshot: Microsoft Learn, Scheduled analytics rules in Microsoft Sentinel, Microsoft (fair use).

Sentinel already pads for some of this. Its scheduled rules overview says the service "runs scheduled analytics rules on a five-minute delay from their scheduled time" to allow for latency between an event's generation and its ingestion. But latency is not uniform. The ingestion delay page notes that "each data source might have its own, individual ingestion delay," and Azure Monitor documents some long ones: resource logs are usually available within 3 to 10 minutes end to end, and activity logs in 3 to 20 minutes. The same Azure Monitor page says ingestion-time transformations and the processing of custom logs can add more.

Microsoft Learn page Log data ingestion time in Azure Monitor, section Azure metrics, resource logs, activity logs, listing latency of 30 seconds to 20 minutes, resource logs within 3 to 10 minutes and activity logs in 3 to 20 minutes.
Screenshot: Microsoft Learn, Log data ingestion time in Azure Monitor, Microsoft (fair use).

Widening the look-back is the obvious fix, and Microsoft warns that it creates a second problem. Overlapping windows can catch the same event twice, and in that case "the event fires two alerts."

Microsoft Learn diagram showing a seven-minute look-back combined with an ingestion_time() greater than ago(5m) restriction, so each event is tied to a single run.
Screenshot: Microsoft Learn, Handle ingestion delay in scheduled analytics rules, Microsoft (fair use).

The documented answer uses two filters. Widen the TimeGenerated window by the measured delay, then keep only the records ingested since the previous run, using the Kusto ingestion_time() function. Microsoft's sample sets a two-minute delay and a five-minute look-back, filters on TimeGenerated >= ago(ingestion_delay + rule_look_back), and then on ingestion_time() > ago(rule_look_back). A late event is picked up by the run that follows its ingestion, and only by that run. Microsoft also points to near-real-time (NRT) rules as an alternative. One caution from the Kusto reference: "The value returned by this function is only approximate."

Microsoft Learn sample Kusto query with let ingestion_delay = 2min and let rule_look_back = 5min, filtering CommonSecurityLog on TimeGenerated and on ingestion_time(), followed by the Calculate ingestion delay section.
Screenshot: Microsoft Learn, Handle ingestion delay in scheduled analytics rules, Microsoft (fair use).

The first job is measuring. Azure Monitor's ingestion time page gives queries that subtract TimeGenerated from ingestion_time() and summarize the 50th and 95th percentiles by computer, and Sentinel's Workspace Usage Report includes a dashboard of latency for the data types flowing into a workspace. For detection engineers, the practical step is to run that measurement against every table a rule reads, especially rules that join sources. "When joining multiple data types, you must understand the different delays for each data type in order to configure the look-back period correctly," Microsoft writes. Then set the rule's window from the slowest source, not from the default.

About the Author

James Whitford

James Whitford covers SOC tooling, SIEM, SOAR, and detection platforms for SOCtember from Austin.

Related stories

Tools desk