Skip to content

Commit c7a2ef7

Browse files
committed
Create custom query how to article
1 parent 7838f4b commit c7a2ef7

File tree

4 files changed

+27
-26
lines changed

4 files changed

+27
-26
lines changed

articles/sentinel/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,8 @@
10081008
href: /azure/data-explorer/kql-quick-reference?toc=/azure/sentinel/TOC.json&bc=/azure/sentinel/breadcrumb/toc.json
10091009
- name: Other KQL resources
10101010
href: kusto-resources.md
1011+
- name: Create custom query
1012+
href: hunts-custom-queries.md
10111013
- name: Hunt with bookmarks
10121014
href: bookmarks.md
10131015
- name: Hunt with livestream

articles/sentinel/hunts-custom-queries.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to create a custom query to hunt for threats.
55
author: austinmccollum
66
ms.author: austinmc
77
ms.topic: how-to
8-
ms.date: 04/23/2024
8+
ms.date: 04/24/2024
99
appliesto:
1010
- Microsoft Sentinel in the Azure portal
1111
- Microsoft Sentinel in the Microsoft Defender portal
@@ -14,7 +14,7 @@ ms.collection: usx-security
1414

1515
# Create custom hunting queries in Microsoft Sentinel
1616

17-
Create or modify a query and save it as your own query or share it with users who are in the same tenant.
17+
Hunt for security threats across your organization's data sources with custom hunting queries. Microsoft Sentinel provides built-in hunting queries to help you find issues in the data you have on your network. But you can create your own custom queries. For more information about hunting queries, see [Threat hunting in Microsoft Sentinel](hunting.md).
1818

1919
## Create a new query
2020

@@ -36,37 +36,36 @@ In Microsoft Sentinel, create a custom hunting query from the **Hunting** > **Qu
3636

3737
1. When your finished defining your query, select **Create**.
3838

39-
**To clone and modify an existing query**:
39+
## Clone an existing query
4040

41-
1. From the table, select the hunting query you want to modify.
42-
1. Select the ellipsis (...) in the line of the query you want to modify, and select **Clone query**.
41+
Clone a custom or built-in query and edit it as needed.
42+
43+
1. From the **Hunting** > **Queries** tab, select the hunting query you want to clone.
44+
1. Select the ellipsis (...) in the line of the query you want to modify, and select **Clone**.
4345

44-
:::image type="content" source="./media/hunting/clone-query.png" alt-text="Clone query" lightbox="./media/hunting/clone-query.png":::
46+
# [Azure portal](#tab/azure-portal)
47+
:::image type="content" source="./media/hunts-custom-queries/clone-hunting-query.png" alt-text="Clone query" lightbox="./media/hunts-custom-queries/clone-hunting-query.png":::
48+
# [Defender portal](#tab/defender-portal)
49+
:::image type="content" source="./media/hunts-custom-queries/clone-hunting-query-defender.png" alt-text="Clone query" lightbox="./media/hunts-custom-queries/clone-hunting-query-defender.png":::
50+
---
51+
1. Edit the query and other fields as appropriate.
52+
1. Select **Create**.
4553

46-
1. Modify the query and select **Create**.
54+
## Edit an existing custom query
4755

48-
**To modify an existing custom query**:
56+
Only queries that from a custom content source can be edited. Other content sources have to be edited at that source.
4957

50-
1. From the table, select the hunting query that you wish to modify. Only queries that from a custom content source can be edited. Other content sources have to be edited at that source.
58+
1. From the **Hunting** > **Queries** tab, select the hunting query you want to change.
5159

52-
1. Select the ellipsis (...) in the line of the query you want to modify, and select **Edit query**.
60+
1. Select the ellipsis (...) in the line of the query you want to change, and select **Edit**.
5361

54-
1. Modify the **Custom query** field with the updated query. You can also modify the entity mapping and techniques as explained in the "**To create a new query**" section of this documentation.
62+
1. Update the **Query** field with the updated query. You can also change the entity mapping and techniques.
63+
1. When finished select **Save**.
5564

56-
## Sample query
65+
## Related content
5766

58-
A typical query starts with a table or parser name followed by a series of operators separated by a pipe character ("\|").
67+
- [KQL quick reference](/azure/data-explorer/kusto/query/kql-quick-reference?toc=%2Fazure%2Fsentinel%2FTOC.json&bc=%2Fazure%2Fsentinel%2Fbreadcrumb%2Ftoc.json)
68+
- [Advanced Security Information Model (ASIM) parser](normalization-about-parsers.md)
69+
- [Threat hunting in Microsoft Sentinel](hunting.md)
70+
- [Conduct end-to-end proactive threat hunting in Microsoft Sentinel](hunts.md)
5971

60-
In the example above, start with the table name SecurityEvent and add piped elements as needed.
61-
62-
1. Define a time filter to review only records from the previous seven days.
63-
64-
1. Add a filter in the query to only show event ID 4688.
65-
66-
1. Add a filter in the query on the command line to contain only instances of cscript.exe.
67-
68-
1. Project only the columns you're interested in exploring and limit the results to 1000 and select **Run query**.
69-
70-
1. Select the green triangle and run the query. You can test the query and run it to look for anomalous behavior.
71-
72-
We recommend that your query uses an [Advanced Security Information Model (ASIM) parser](normalization-about-parsers.md) and not a built-in table. This ensures that the query will support any current or future relevant data source rather than a single data source.
163 KB
Loading
200 KB
Loading

0 commit comments

Comments
 (0)