Top 10 Log Sources With Cost


Top log sources by `DataType` (30d) with numeric `CostUSD`. The chart-friendly default.

KQL Library  /  Cost & Ingest

 Cost & Ingest Cost By Table top-10-log-sources-with-cost.kql

Top log sources by `DataType` (30d) with numeric `CostUSD`. The chart-friendly default.

Platforms Microsoft Sentinel
Data Usage
Deep Dive  Deep Dive
// Author: Ian D. Hanley (DevSecOpsDad) | linkedin.com/in/ianhanley | devsecopsdad.com | devsecopsdadattack.com
// Top 10 most expensive log sources by DataType over the last 30 days, with a numeric CostUSD column.
// Use this variant when you want the raw numbers — CostUSD stays a float so it plays nicely with
// dashboards and downstream aggregation. For a display-friendly variant with cost-tier emojis,
// see top-10-log-sources-with-cost-enhanced.kql.
// Source: KQL Toolbox #2: Find Your Noisiest Log Sources (with Cost) (2026-01-05) — https://www.hanley.cloud/2026-01-05-KQL-Toolbox-2-Find-Your-Noisiest-Log-Sources-%28with-Cost-%29/
// Platforms: Microsoft Sentinel
// Data: Usage

let PricePerGB = 5.16;   // <-- Replace with your region's actual Sentinel price per GB
Usage
| where TimeGenerated > ago(30d)
| where IsBillable == true
| summarize TotalGiB = round(sum(Quantity) / 1024.0, 2) by DataType
| extend CostUSD = round(TotalGiB * PricePerGB, 2)
| top 10 by CostUSD desc
| order by CostUSD desc