Part 3: Advanced Query Operators and Functions
Moving Beyond the Basics
join - Combining Data from Multiple Tables
Join Types I Use
// Correlate VM performance with heartbeat data
Perf
| where TimeGenerated > ago(1h)
| where CounterName == "% Processor Time"
| summarize AvgCpu = avg(CounterValue) by Computer, bin(TimeGenerated, 5m)
| join kind=innerunique (
Heartbeat
| where TimeGenerated > ago(1h)
| summarize LastHeartbeat = max(TimeGenerated) by Computer
) on Computer
| project Computer, AvgCpu, LastHeartbeatReal-World Join Pattern: Correlating Application and Infrastructure
Join Performance Tips from Experience
union - Combining Similar Tables
Basic Union:
Union with Wildcards:
Cross-Workspace Queries:
Real Pattern: Unified Error Dashboard
mv-expand - Expanding Multi-Value Fields
Expanding Arrays:
Real Pattern: Analyzing Tags
Expanding Nested JSON:
parse - Extracting Structured Data
Simple Parse:
Multiple Parse Patterns:
Real Pattern: Parsing API Gateway Logs
make-series - Time Series Analysis
Basic Time Series:
Time Series with Gap Filling:
Real Pattern: Anomaly Detection
let - Creating Variables and Functions
Variable Definition:
Tabular Variables:
Functions with let:
Real Pattern: Reusable Time Windows
Advanced Functions
String Functions:
Array and Bag Functions:
Mathematical Functions:
Complex Real-World Query Patterns
Pattern 1: Request Success Rate with Latency Analysis
Pattern 2: Resource Health Correlation Matrix
Pattern 3: Service Dependency Analysis
Query Optimization Techniques
1. Use materialized views for repeated queries:
2. Partition by time first:
3. Use summarize instead of distinct when possible:
Key Takeaways
Last updated