Query Details

Table Data

Query

//Produces results for Table Size, Number of Table Entries, Size per Entry, If the table is billable or not, Last record that was received, and Estimated Table Price


union withsource=TableName1 *
| where TimeGenerated > ago(31d)
| 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 Size'] = Size,
    ['Table Entries'] = Entries,
    ['Size per Entry'] = 1.0 * Size / Entries,
    ['IsBillable'] = _IsBillable,
    ['Last Record Received'] =  last_log,
    ['Estimated Table Price'] =  (estimate / (1024 * 1024 * 1024)) * 4.0
| order by ['Table Size']  desc

Explanation

This query calculates and displays information about a table, including its size, number of entries, size per entry, if it is billable or not, the last record received, and an estimated price for the table. It filters data from the last 31 days, groups it by table name and billable status, and then calculates the required metrics before ordering the results by table size in descending order.

Details

Rod Trent profile picture

Rod Trent

Released: April 4, 2024

Tables

TableName1

Keywords

TableSize,NumberofTableEntries,SizeperEntry,IsBillable,LastRecordReceived,EstimatedTablePrice,TableName1,_BilledSize,_IsBillable,TimeGenerated.

Operators

unionwithsourcewheresummarizecountsumlastdatetime_diffnowmaxsumifprojectprojectorder by

Actions