Alias statement

Alias statements allow you to define an alias for databases, which can be used later in the same query.

This is useful when you're working with several clusters but want to appear as if you're working on fewer clusters. The alias must be defined according to the following syntax, where clustername and databasename are existing and valid entities.


alias database['DatabaseAliasName'] = cluster("").database("databasename")

alias database DatabaseAliasName = cluster("").database("databasename")

  • 'DatabaseAliasName' can be either an existing name or a new name.
  • The mapped cluster-uri and the mapped database-name must appear inside double-quotes(") or single-quotes(')


alias database["wiki"] = cluster("").database("somedatabase");
database("wiki").PageViews | count 
alias database Logs = cluster("").database("otherdatabase");
database("Logs").Traces | count 

This capability isn't supported in Azure Monitor