You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/essentials/data-collection-rule-edit.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,9 @@
2
2
title: Tutorial - Editing Data Collection Rules
3
3
description: This article describes how to make changes in Data Collection Rule definition using command line tools and simple API calls.
4
4
ms.topic: tutorial
5
+
author: bwren
6
+
ms.author: bwren
7
+
ms.reviewer: ivankh
5
8
ms.date: 05/31/2022
6
9
---
7
10
@@ -17,8 +20,8 @@ In this tutorial, you learn how to:
17
20
18
21
## Prerequisites
19
22
To complete this tutorial you need the following:
20
-
- Log Analytics workspace where you have at least [contributor rights](manage-access.md#manage-access-using-azure-permissions).
21
-
-[Permissions to create Data Collection Rule objects](/azure/azure-monitor/essentials/data-collection-rule-overview#permissions) in the workspace.
23
+
- Log Analytics workspace where you have at least [contributor rights](../manage-access.md#manage-access-using-azure-permissions).
24
+
-[Permissions to create Data Collection Rule objects](data-collection-rule-overview#permissions.md) in the workspace.
22
25
- Up to date version of PowerShell. Using Azure Cloud Shell is recommended.
23
26
24
27
## Overview of tutorial
@@ -30,13 +33,13 @@ While going through the wizard on the portal is the simplest way to set up the i
30
33
In this tutorial, you will, first, set up ingestion of a custom log, then. you will modify the KQL transformation for your custom log to include additional filtering and apply the changes to your DCR. Finally, we are going to combine all editing operations into a single PowerShell script, which can be used to edit any DCR for any of the above mentioned reasons.
31
34
32
35
## Set up new custom log
33
-
Start by setting up a new custom log. Follow [Tutorial: Send custom logs to Azure Monitor Logs using the Azure portal (preview)](/azure/azure-monitor/logs/tutorial-custom-logs). Note the resource ID of the DCR created.
36
+
Start by setting up a new custom log. Follow [Tutorial: Send custom logs to Azure Monitor Logs using the Azure portal (preview)](../logs/tutorial-custom-logs.md). Note the resource ID of the DCR created.
34
37
35
38
## Retrieve DCR content
36
39
In order to update DCR, we are going to retrieve its content and save it as a file, which can be further edited.
37
40
1. Click the **Cloud Shell** button in the Azure portal and ensure the environment is set to **PowerShell**.
38
41
39
-
:::image type="content" source="media/tutorial-ingestion-time-transformations-api/open-cloud-shell.png" lightbox="media/tutorial-ingestion-time-transformations-api/open-cloud-shell.png" alt-text="Screenshot of opening cloud shell":::
42
+
:::image type="content" source="../logs/media/tutorial-ingestion-time-transformations-api/open-cloud-shell.png" lightbox="media/tutorial-ingestion-time-transformations-api/open-cloud-shell.png" alt-text="Screenshot of opening cloud shell":::
40
43
41
44
2. Execute the following commands to retrieve DCR content and save it to a file. Replace `<ResourceId>` with DCR ResourceID and `<FilePath>` with the name of the file to store DCR.
Now, when DCR content is stored as a JSON file, you can use an editor of your choice to make changes in the DCR. You may [prefer to download the file from the Cloud Shell environment](azure/cloud-shell/using-the-shell-window#upload-and-download-files), if you are using one.
53
+
Now, when DCR content is stored as a JSON file, you can use an editor of your choice to make changes in the DCR. You may [prefer to download the file from the Cloud Shell environment](../../cloud-shell/using-the-shell-window#upload-and-download-files.md), if you are using one.
51
54
52
55
Alternatively you can use code editors supplied with the environment. For example, if you saved your DCR in a file named `temp.dcr` on your Cloud Drive, you could use the following command to open DCR for editing right in the Cloud Shell window:
53
56
```PowerShell
@@ -68,7 +71,7 @@ Let’s modify the KQL transformation within DCR to drop rows where RequestType
68
71
69
72
## Apply changes
70
73
Our final step is to update DCR back in the system. This is accomplished by “PUT” HTTP call to ARM API, with updated DCR content sent in the HTTP request body.
71
-
1. If you are using Azure Cloud Shell, save the file and close the embedded editor, or [upload modified DCR file back to the Cloud Shell environment](azure/cloud-shell/using-the-shell-window#upload-and-download-files).
74
+
1. If you are using Azure Cloud Shell, save the file and close the embedded editor, or [upload modified DCR file back to the Cloud Shell environment](../../cloud-shell/using-the-shell-window#upload-and-download-files.md).
72
75
2. Execute the following commands to load DCR content from the file and place HTTP call to update the DCR in the system. Replace `<ResourceId>` with DCR ResourceID and `<FilePath>` with the name of the file modified in the previous part of the tutorial. You can omit first two lines if you read and write to the DCR within the same PowerShell session.
73
76
```PowerShell
74
77
$ResourceId = “<ResourceId>” # Resource ID of the DCR to edit
0 commit comments