Created
July 30, 2022 02:17
-
-
Save s4parke/25a69a90738d3f9738bbd510929897e2 to your computer and use it in GitHub Desktop.
Kusto query for table size, number of entries, isBillable, recency in AZ log analytics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
union withsource=TableName1 * | |
| where TimeGenerated > ago(30d) | |
| summarize | |
Entries = count(), | |
Size = sum(_BilledSize), | |
last_log = datetime_diff("second", now(), max(TimeGenerated)), | |
estimate = sumif(_BilledSize, _IsBillable == true) | |
by TableName1, _IsBillable | |
| project | |
['Table Name'] = TableName1, | |
['Table Entries'] = Entries, | |
['Table Size'] = Size, | |
['Size per Entry'] = 1.0 * Size / Entries, | |
['IsBillable'] = _IsBillable, | |
['Last Entry Ago (s)'] = last_log, | |
['Estimated Table Price'] = (estimate / (1024 * 1024 * 1024)) * 0.0 | |
| order by ['Table Size'] desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment