I'm using Kusto API to query logs from 2 tables, however they are in 2 different databases which are in different clusters and therefore have different endpoints (I can't modify the clusters). I would like to know if it's possible to use Kusto API to query logs from both tables
Asked
Active
Viewed 33 times
2
-
Why don't you simply use two clients? – Yochai Gilad Aug 03 '23 at 08:00
1 Answers
1
regardless of which client library/tool you're using, and as long as you have read-permissions to both databases - you can include a reference to a database in a different cluster within the query text.
- the cluster you choose to run the query against will run the sub-query against the 2nd cluster.
- see: Cross-cluster and cross-database queries
for example, run the following query on database database1
on cluster cluster1.westus
:
union withsource = T
Table1, // this is in 'database1' in 'cluster1.westus'
cluster("cluster2.westus2").database("database2").Table2,
cluster("cluster2.centralus").database("database3").Table3
| where Timestamp > ago(1h)
| summarize count() by T

Yoni L.
- 22,627
- 2
- 29
- 48
-
While this is true it does forcibly route the query through the cluster supplied at client creation time. – Yochai Gilad Aug 03 '23 at 08:00