Currently I can use azure-kusto-python to query a single cluster and a single database:
The KQL query:
StormEventInfo
| take 10
| where environment contains "templ"
| where userType == "user" or isempty(userType)
the python code is as follows:
client = KustoClient(
KustoConnectionStringBuilder.with_aad_application_key_authentication(
KUSTO_CLUSTER,
CLIENT_ID,
CLIENT_SECRET,
AAD_TENANT_ID
)
)
response = client.execute(MY_DB_ID, query)
But if the KQL query is as following(it is cross-cluster and databases, this is an aggregate query), how should I code here in python with this sdk?
let Cluster = entity_group [
cluster('https://b1.abc.net/').database('2f43e3ae086a0'), cluster('https://b2.abc.net').database('6a009979fa88')
];
macro-expand Cluster as X (
X.StormEventInfo
| take 10
| where environment contains "templ"
| where userType == "user" or isempty(userType)
Thanks for the help guys!