getting Kusto table name for output of union *

Viewed 1078

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 ?

1 Answers

You can use withsource (see in documentation)

execute query

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