A security engineer builds a Microsoft Sentinel analytics rule that queries AzureDiagnostics for Azure OpenAI API calls and joins with SigninLogs to identify cases where a user accesses Azure OpenAI within 5 minutes of a suspicious sign-in. The KQL query has performance issues with high query times. Which KQL optimization should be applied first?
Select an answer to reveal the explanation.
Short Explanation
Here's the deal — filter both AzureDiagnostics and SigninLogs to the relevant time range with 'ago()' before you join them. That cuts the data scanned first, which is usually what makes Sentinel analytics rules slow.
Full Explanation
The first optimization to apply is adding time-range filters on both tables before the join, using the 'ago()' function to limit the data scanned. For join queries across large tables, the most impactful KQL performance optimization is filtering each table to the relevant time range before performing the join. Using 'ago()' to filter AzureDiagnostics and SigninLogs to only the lookback window, such as the last 24 hours, dramatically reduces the data volume that must be processed in the join, which is the most common cause of slow Sentinel analytics rule queries. Replacing the join operator with a union operator to merge the tables is incorrect because union appends rows from both tables rather than matching records across them, so it does not achieve the same correlation purpose. Using the 'hint.shufflekey' join strategy to distribute the join across multiple nodes is incorrect because 'hint.shufflekey' optimizes join performance for high-cardinality keys in large datasets, but the primary optimization should be reducing data volume through time filtering before applying join strategy hints. Adding a 'take 1000' operator to limit the result set is incorrect because 'take 1000' limits the result set arbitrarily after processing, not the input data volume; it would produce incorrect or incomplete results and would not meaningfully improve query performance on large input tables.