Query Details
//This query monitors data ingestion freshness across Sentinel tables
//Identifies delays and assigns status based on warning/critical thresholds
// Define warning and critical thresholds
let warningThresholdDays = 3;
let criticalThresholdDays = 7;
union withsource = SentinelTableName *
| where TimeGenerated > ago(30d)
| summarize LastIngestionTime = max(TimeGenerated) by SentinelTableName
| extend DaysSinceLastIngestion = datetime_diff('day', now(), LastIngestionTime)
| extend Status = case(
DaysSinceLastIngestion > criticalThresholdDays, "🔴 Critical: Ingestion Delayed",
DaysSinceLastIngestion > warningThresholdDays, "🟡 Warning: Needs Attention",
DaysSinceLastIngestion == 0, "🟢 Up to Date",
"🟡 Acceptable: Recently Ingested"
)
| sort by DaysSinceLastIngestion desc This query is designed to monitor how up-to-date the data ingestion is for various tables in Microsoft Sentinel. It checks when data was last ingested into each table and categorizes the freshness of this data based on specific time thresholds. Here's a breakdown of what it does:
Thresholds Definition: It sets two thresholds for data freshness:
Data Collection: It gathers data from all Sentinel tables, focusing on entries from the last 30 days.
Last Ingestion Time: For each table, it determines the most recent time data was ingested.
Days Calculation: It calculates how many days have passed since the last data ingestion for each table.
Status Assignment: Based on the number of days since the last ingestion, it assigns a status to each table:
Sorting: Finally, it sorts the tables by the number of days since the last ingestion, with the most delayed tables appearing first.

Antone Andrade
Released: November 10, 2024
Tables
Keywords
Operators