다음을 통해 공유


Alias statement

Applies to: ✅Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

별칭 문을 사용하면 동일한 쿼리에서 사용할 수 있는 데이터베이스에 대한 별칭을 정의할 수 있습니다.

alias 문은 데이터베이스의 약식 이름으로 유용하므로 동일한 쿼리에서 해당 별칭을 사용하여 참조할 수 있습니다.

Syntax

alias database DatabaseAliasName= cluster("QueryURI").database("DatabaseName")

Learn more about syntax conventions.

Parameters

Name Type Required Description
DatabaseAliasName string ✔️ 기존 이름 또는 새 데이터베이스 별칭 이름입니다. 대괄호로 이름을 이스케이프할 수 있습니다. 예를 들어 ["공백이 있는 이름"]입니다.
QueryURI string ✔️ 쿼리 또는 관리 명령을 실행하는 데 사용할 수 있는 URI입니다.
DatabaseName string ✔️ 별칭을 지정할 데이터베이스의 이름입니다.

Note

  • 쿼리 URI를 얻으려면 Azure Portal에서 클러스터의 개요 페이지로 이동한 다음 URI를 복사합니다.
  • 매핑된 쿼리 및 매핑된 데이터베이스 이름은 큰따옴표(") 또는 작은따옴표(')에 나타나야 합니다.

Note

  • 쿼리 URI를 얻으려면 KQL 데이터베이스 URI복사를 참조하세요.
  • 매핑된 쿼리 및 매핑된 데이터베이스 이름은 큰따옴표(") 또는 작은따옴표(')에 나타나야 합니다.

Examples

The examples in this article use publicly available tables in the help cluster, such as the StormEvents table in the Samples database.

The examples in this article use publicly available tables, such as the Weather table in the Weather analytics sample gallery. 작업 영역의 테이블과 일치하도록 예제 쿼리에서 테이블 이름을 수정해야 할 수 있습니다.

먼저 해당 테이블의 레코드 수를 계산합니다.

StormEvents
| count

Output

Count
59066

그런 다음 데이터베이스에 별칭을 Samples 지정하고 해당 이름을 사용하여 테이블의 StormEvents 레코드 수를 확인합니다.

alias database samplesAlias = cluster("https://help.kusto.windows.net").database("Samples");
database("samplesAlias").StormEvents | count

Output

Count
59066

대괄호 구문을 사용하여 공백이 포함된 별칭 이름을 만듭니다.

alias database ["Samples Database Alias"] = cluster("https://help.kusto.windows.net").database("Samples");
database("Samples Database Alias").StormEvents | count

Output

Count
59066