Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a0ad08c
Create entity-group-alter.md
ziham1531991 Jan 13, 2025
ad34ef2
Create entity-group-alter-merge.md
ziham1531991 Jan 13, 2025
a4cde24
Create entity-group-create.md
ziham1531991 Jan 13, 2025
06b25ad
Create entity-group-drop.md
ziham1531991 Jan 13, 2025
e92cb34
Create show-entity-group.md
ziham1531991 Jan 13, 2025
a65c900
Create entity-groups.md
ziham1531991 Jan 13, 2025
d6bdcf1
Rename entity-group-alter-merge.md to alter-merge-entity-group.md
ziham1531991 Jan 13, 2025
1a6e7dd
Rename entity-group-alter.md to alter-entity-group.md
ziham1531991 Jan 13, 2025
932d500
Rename entity-group-create.md to create-entity-group.md
ziham1531991 Jan 13, 2025
4b70c77
Rename entity-group-drop.md to drop-entity-group.md
ziham1531991 Jan 13, 2025
145d60e
Update entity-groups.md
ziham1531991 Jan 13, 2025
8e0e33a
Update toc.yml
ziham1531991 Jan 13, 2025
0d563dc
Create macro-expand-operator.md
ziham1531991 Jan 13, 2025
0aae5e8
Update toc.yml
ziham1531991 Jan 13, 2025
2ecbc39
Update macro-expand-operator.md
ziham1531991 Jan 13, 2025
28a3b4f
Update toc.yml
ziham1531991 Jan 13, 2025
c27711b
Merge branch 'patch-7' of https://github.com/ziham1531991/dataexplore…
mjosephym Jan 19, 2025
ef68ae3
entity groups and macro-expand
mjosephym Jan 20, 2025
7be095f
Merge branch 'main' of https://github.com/MicrosoftDocs/dataexplorer-…
mjosephym Jan 20, 2025
12df445
edits
mjosephym Jan 20, 2025
aef3d2e
edit
mjosephym Jan 20, 2025
32ea6ec
edit
mjosephym Jan 20, 2025
04151b5
edit
mjosephym Jan 21, 2025
1f8292f
edits
mjosephym Jan 21, 2025
743f501
Merge branch 'main' of https://github.com/MicrosoftDocs/dataexplorer-…
mjosephym Jan 26, 2025
e2cf6e4
edits
mjosephym Jan 27, 2025
39aa76a
edits
mjosephym Jan 27, 2025
49e4dd0
edits
mjosephym Jan 27, 2025
8ace6cb
edits
mjosephym Jan 27, 2025
0539733
Update data-explorer/kusto/management/toc.yml
mjosephym Jan 28, 2025
05ee044
Update data-explorer/kusto/query/macro-expand-operator.md
mjosephym Jan 28, 2025
8ed7eb6
edits
mjosephym Jan 29, 2025
81756d4
edits
mjosephym Jan 29, 2025
dfc441f
Update data-explorer/kusto/query/macro-expand-operator.md
mjosephym Jan 30, 2025
7b55419
Update data-explorer/kusto/query/macro-expand-operator.md
mjosephym Jan 30, 2025
59c490c
Update data-explorer/kusto/query/macro-expand-operator.md
mjosephym Jan 30, 2025
d7b14a1
Update data-explorer/kusto/query/macro-expand-operator.md
mjosephym Jan 30, 2025
df5a5b0
edits
mjosephym Jan 30, 2025
ec1e229
Apply suggestions from code review
shsagir Feb 2, 2025
bfc2639
Update data-explorer/kusto/query/macro-expand-operator.md
ttorble Feb 3, 2025
16e4b14
Merge pull request #6558 from mjosephym/362535-kql-entity-group
ttorble Feb 3, 2025
84b3eb5
Merge pull request #6606 from MicrosoftDocs/main
ttorble Feb 3, 2025
295d64e
Merging changes synced from https://github.com/MicrosoftDocs/dataexpl…
Feb 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions data-explorer/kusto/management/alter-entity-group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: .alter entity_group command
description: Learn how to use the `.alter entity_group` command to change an existing entity group.
ms.reviewer: ziham1531991
ms.topic: reference
ms.date: 01/26/2025
---


# .alter entity_group command

> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)]

Alters an existing entity group and stores it inside the database metadata. For more information, see [Entity groups](entity-groups.md).

## Permissions

You must have at least [Database Admin](../access-control/role-based-access-control.md) permissions to run this command.

## Syntax

`.alter` `entity_group` [`ifnotexists`] *EntityGroupName* `(`*EntityReference* [`,` ...]`)`

[!INCLUDE [syntax-conventions-note](../includes/syntax-conventions-note.md)]

## Parameters

|Name|Type|Required|Description|
|--|--|--|--|
| `ifnotexists` | `string` | | If specified, the entity group is only created if the entity group doesn't exist yet.|
|*EntityGroupName*| `string` | :heavy_check_mark:|The name of the entity group. |
|*EntityReference*| `string` | :heavy_check_mark:|An entity included in the entity group. |

## Returns

This command returns a table with the following columns:

|Output parameter |Type |Description|
|---|---|---|
|Name | `string` | The name of the entity group.|
|Entities | `array` | An array which includes one or more entities. If the entity group doesn't exist, and the `ifnotexists` flag isn't specified, an error is returned.|

## Examples

The following example alters `MyEntityGroup` to include the entity, `cluster('c1').database('d1')`.

```kusto
.alter entity_group MyEntityGroup (cluster('c1').database('d1'))
```

**Output**

|Name|Entities|
|---|---|
|MyEntityGroup|["cluster('c1').database('d1')"]|

## Related content

* [Entity groups](entity-groups.md)
* [Entity types](../query/schema-entities/index.md)
* [.create entity_group command](create-entity-group.md)
* [.alter-merge entity_group command](alter-merge-entity-group.md)
* [.drop entity_group command](drop-entity-group.md)
* [.show entity_group(s) command](show-entity-group.md)
76 changes: 76 additions & 0 deletions data-explorer/kusto/management/alter-merge-entity-group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: .alter-merge entity_group command
description: Learn how to use the `.alter-merge entity_group` command to change an existing entity group.
ms.reviewer: ziham1531991
ms.topic: reference
ms.date: 01/26/2025
---

# .alter-merge entity_group command

> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)]

Alters and merges an existing entity group with the provided list of entities and stores it inside the database metadata. For more information, see [Entity groups](entity-groups.md).

## Permissions

You must have at least [Database Admin](../access-control/role-based-access-control.md) permissions to run this command.

## Syntax

`.alter-merge` `entity_group` *EntityGroupName* `(`*EntityReference* [`,` ...]`)`

[!INCLUDE [syntax-conventions-note](../includes/syntax-conventions-note.md)]

## Parameters

|Name|Type|Required|Description|
|--|--|--|--|
|*EntityGroupName*| `string` | :heavy_check_mark:|The name of the entity group. |
|*EntityReference*| `string` | :heavy_check_mark:|An entity included in the entity group. |

## Returns

This command returns a table with the following columns:

|Output parameter |Type |Description|
|---|---|---|
|Name | `string` | The name of the entity group.|
|Entities | `array` | An array which includes one or more entities.|

## Examples

The following example edits the `MyEntityGroup` entity group and adds the entity `cluster('c2').database('d2')` to the entity group.

First run the following command to create a new entity group with entity `cluster('c1').database('d1')`:

```kusto
.create entity_group MyEntityGroup (cluster('c1').database('d1'))
```

**Output**

|Name|Entities|
|---|---|
|MyEntityGroup|["cluster('c1').database('d1')"]|

Then run the following command to edit the existing entity group `MyEntityGroup` and add the entity `cluster('c2').database('d2')`:

```kusto
.alter-merge entity_group MyEntityGroup (cluster('c2').database('d2'))
```

**Output**

|Name|Entities|
|---|---|
|MyEntityGroup|["cluster('c1').database('d1')","cluster('c2').database('d2')"]|

## Related content

* [Entity groups](entity-groups.md)
* [Entity types](../query/schema-entities/index.md)
* [.create entity_group command](create-entity-group.md)
* [.alter entity_group command](alter-entity-group.md)
* [.drop entity_group command](drop-entity-group.md)
* [.show entity_group(s) command](show-entity-group.md)
61 changes: 61 additions & 0 deletions data-explorer/kusto/management/create-entity-group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: .create entity_group command
description: Learn how to use the `.create entity_group` command to create an entity group.
ms.reviewer: ziham1531991
ms.topic: reference
ms.date: 01/27/2025
---

# .create entity_group command

> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)]

Creates a stored entity group with a specific name, which functions like a reusable [`let` statement](../query/let-statement.md). The entity group definition is saved as part of the database metadata.

## Permissions

You must have at least [Database Admin](../access-control/role-based-access-control.md) permissions to run this command.

## Syntax

`.create` `entity_group` [`ifnotexists`] *EntityGroupName* `(`[*EntityReference*`,` ...]`)`

[!INCLUDE [syntax-conventions-note](../includes/syntax-conventions-note.md)]

## Parameters

|Name|Type|Required|Description|
|--|--|--|--|
| `ifnotexists` | `string` | | If specified, the entity group is only created if the entity group doesn't exist yet.|
|*EntityGroupName*| `string` | :heavy_check_mark:|The name of the entity group. |
|*EntityReference*| `string` | :heavy_check_mark:|An entity included in the entity group. |

## Returns

This command returns a table with the following columns:

|Output parameter |Type |Description|
|---|---|---|
|Name | `string` | The name of the entity group.|
|Entities | `array` | An array which includes one or more entities. If the entity group already exists, and the `ifnotexists` flag is specified, the command is ignored. Otherwise, an error is returned.|

## Examples

The following example creates the `MyEntityGroup` entity group with two entities, `cluster('c1').database('d1')` and `cluster('c2').database('d2')`.

```kusto
.create entity_group MyEntityGroup (cluster('c1').database('d1'), cluster('c2').database('d2'))
```

|Name|Entities|
|---|---|
|MyEntityGroup|["cluster('c1').database('d1')","cluster('c2').database('d2')"]|

## Related content

* [Entity groups](entity-groups.md)
* [Entity types](../query/schema-entities/index.md)
* [.alter entity_group command](alter-entity-group.md)
* [.alter-merge entity_group command](alter-merge-entity-group.md)
* [.drop entity_group command](drop-entity-group.md)
* [.show entity_group(s) command](show-entity-group.md)
55 changes: 55 additions & 0 deletions data-explorer/kusto/management/drop-entity-group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: .drop entity_group command
description: Learn how to use the `.drop entity_group` command to remove an entity group from your database.
ms.reviewer: ziham1531991
ms.topic: reference
ms.date: 01/27/2025
---

# .drop entity_group command

> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)]

Drops an entity group from a database.

## Permissions

You must have at least [Database Admin](../access-control/role-based-access-control.md) permissions to run this command.

## Syntax

`.drop` `entity_group` *EntityGroupName*

[!INCLUDE [syntax-conventions-note](../includes/syntax-conventions-note.md)]

## Parameters

|Name|Type|Required|Description|
|--|--|--|--|
|*EntityGroupName*| `string` | |The name of the specific entity group you want to drop. |

## Returns

This command returns a list of the remaining tables in the database.

|Output parameter |Type |Description|
|---|---|---|
|Name | `string` | The name of the entity group.|
|Entities | `array` | An array with one or more entities.|

## Examples

The following example drops the `MyEntityGroup` from your selected database.

```kusto
.drop entity_group MyEntityGroup
```

## Related content

* [Entity groups](entity-groups.md)
* [Entity types](../query/schema-entities/index.md)
* [.create entity_group command](create-entity-group.md)
* [.alter entity_group command](alter-entity-group.md)
* [.alter-merge entity_group command](alter-merge-entity-group.md)
* [.show entity_group(s) command](show-entity-group.md)
34 changes: 34 additions & 0 deletions data-explorer/kusto/management/entity-groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Entity groups
description: Learn how to use Entity groups to store entity groups in the database.
ms.reviewer: ziham1531991
ms.topic: reference
ms.date: 01/26/2025
---

# Entity groups

> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)]

Entity groups are named entities stored in a database that the [macro-expand query operator](../query/macro-expand-operator.md) can reference.


Storing an entity group in the database, instead of providing its value in the query text itself, makes it easier to manage these objects.

## Management commands

|Function |Description|
|---------|-----------|
|[.alter entity_group](alter-entity-group.md) |Alters an existing entity group and stores it inside the database metadata. |
|[.alter-merge entity_group](alter-merge-entity-group.md) |Alters and merges the value of an existing entity group. |
|[.create entity_group](create-entity-group.md) |Creates a stored entity group.|
|[.drop entity_group](drop-entity-group.md) |Drops an entity group from the database. |
|[.show entity_group(s)](show-entity-group.md) |Lists all the stored entity groups, or a specific entity group, in the current database.|

> [!NOTE]
> A query can only reference entity groups defined in the query text or in the scoped database. Out-of-scope entity groups that aren't within the query or database can’t be directly or indirectly referenced.

## Related content

* [macro-expand operator](../query/macro-expand-operator.md)
* [Entity types](../query/schema-entities/index.md)
82 changes: 82 additions & 0 deletions data-explorer/kusto/management/show-entity-group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: .show entity_group(s) command
description: Learn how to use the `.show entity_group` command to view existing entity groups.
ms.reviewer: ziham1531991
ms.topic: reference
ms.date: 01/27/2025
---

# .show entity_group(s) command

> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)]

Lists all the [entity groups](entity-groups.md) in the selected database or lists the details of one specific stored entity group.

## Permissions

You must have at least [Database Admin](../access-control/role-based-access-control.md) permissions to run this command.

## Syntax

`.show` `entity_groups`

`.show` `entity_group` *EntityGroupName*

[!INCLUDE [syntax-conventions-note](../includes/syntax-conventions-note.md)]

## Parameters

|Name|Type|Required|Description|
|--|--|--|--|
|*EntityGroupName*| `string` | |The name of the specific entity group you wish to view. |

## Returns

This command returns a table with the following columns:

|Output parameter |Type |Description|
|---|---|---|
|Name | `string` | The name of the entity group.|
|Entities | `array` | An array which includes one or more entities. If the entity group doesn't exist, an error is returned.|

## Examples

The following examples show how to use the `.show entity_group` and `.show entity_group` commands.

### Show entity groups

The following example returns all the entity groups in the selected database, `eg1` and `eg2`, along with their entities.

```kusto
.show entity_groups
```

**Output**

|Name|Entities|
|---|---|
|eg1|["cluster('c1').database('d1')"]|
|eg2|["cluster('c2').database('d2')"]|

### Show an entity group

The following example returns the entity group, `eg1` along with its entity, `cluster('c1').database('d1')`.

```kusto
.show entity_group eg1
```

**Output**

|Name|Entities|
|---|---|
|eg1|["cluster('c1').database('d1')"]|

## Related content

* [Entity groups](entity-groups.md)
* [Entity types](../query/schema-entities/index.md)
* [.alter entity_group command](alter-entity-group.md)
* [.alter-merge entity_group command](alter-merge-entity-group.md)
* [.create entity_group command](create-entity-group.md)
* [.drop entity_group command](drop-entity-group.md)
Loading