Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kusto - how to ingest from query using management (.show) function

I want to have a table that stores only daily tables sizes.

But it won't work this way:

.set-or-replace async tables_daily_storage <| 
(
.show cluster extents 
| where MinCreatedOn  >= startofday(now())
| project DatabaseName,TableName,OriginalSize,D=bin(MinCreatedOn,1d) 
| summarize total_size=sum(OriginalSize) by DatabaseName, TableName
)

Because I used .show function which is a management function.

Is there anything to get around this problem?

like image 652
user1432193 Avatar asked Jan 24 '26 16:01

user1432193


1 Answers

Simply remove the brackets
doc

.set-or-replace async tables_daily_storage <| 
.show cluster extents 
| where MinCreatedOn  >= startofday(now())
| project DatabaseName,TableName,OriginalSize,D=bin(MinCreatedOn,1d) 
| summarize total_size=sum(OriginalSize) by DatabaseName, TableName
like image 200
David דודו Markovitz Avatar answered Jan 26 '26 19:01

David דודו Markovitz