Dhiraj
Dhiraj

Reputation: 3696

getting Kusto table name for output of union *

The Kusto operator union * gets all the tables from a database , but once the data is clubbed together , we have no way to tell which rows came from where. Is there a way to force union * to add a column to the output that will contain name of the table a specific row came from ?

Upvotes: 3

Views: 3985

Answers (1)

rony l
rony l

Reputation: 6002

You can use withsource (see in documentation)

execute query

union withsource=TableName * 
| summarize count() by TableName 
| top 2 by count_

Upvotes: 4

Related Questions