Query Details

Table Usageand Cost

Query

//Shows Tables by Table size and how much it costs
//For the 0.0 - Enter your price (tip. Use the Azure Pricing Calculator, enter a value of 1GB and divide by 30days)

 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 Record Received'] =  last_log , ['Estimated Table Price'] =  (estimate/(1024*1024*1024)) * 0.0
 | order by ['Table Size']  desc

Explanation

This query shows tables sorted by their size and calculates the estimated cost for each table. It counts the number of entries in each table, calculates the total size of each table, and determines the last time a log was received for each table. It also calculates the estimated price for each table based on the table size. The results are then ordered by table size in descending order.

Details

Rod Trent profile picture

Rod Trent

Released: August 20, 2020

Tables

TableName1

Keywords

Tables,TableName1,TimeGenerated,_BilledSize,_IsBillable,Entries,Size,last_log,estimate

Operators

unionwithsourcewheresummarizecount()sum()datetime_diff()now()max()sumif()byprojectorder bydesc

Actions