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/logs/tutorial-logs-ingestion-api.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: 'Tutorial: Send data to Azure Monitor Logs using REST API (Resource Manager templates)'
3
3
description: Tutorial on how to send data to a Log Analytics workspace in Azure Monitor by using the REST API Azure Resource Manager template version.
4
4
ms.topic: tutorial
5
-
ms.date: 07/15/2022
5
+
ms.date: 02/01/2023
6
6
---
7
7
8
8
# Tutorial: Send data to Azure Monitor Logs using REST API (Resource Manager templates)
@@ -90,9 +90,14 @@ Use the **Tables - Update** API to create the table with the following PowerShel
90
90
"description": "Additional message properties"
91
91
},
92
92
{
93
-
"name": "ExtendedColumn",
93
+
"name": "CounterName",
94
94
"type": "string",
95
-
"description": "An additional column extended at ingestion time"
95
+
"description": "Name of the counter"
96
+
},
97
+
{
98
+
"name": "CounterValue",
99
+
"type": "real",
100
+
"description": "Value collected for the counter"
96
101
}
97
102
]
98
103
}
@@ -180,7 +185,7 @@ A [DCE](../essentials/data-collection-endpoint-overview.md) is required to accep
180
185
:::image type="content" source="media/tutorial-logs-ingestion-api/data-collection-endpoint-json.png" lightbox="media/tutorial-logs-ingestion-api/data-collection-endpoint-json.png" alt-text="Screenshot that shows the DCE resource ID.":::
181
186
182
187
## Create a data collection rule
183
-
The [DCR](../essentials/data-collection-rule-overview.md) defines the schema of data that's being sent to the HTTP endpoint. It also defines the transformation that will be applied to it. The DCR also defines the destination workspace and table the transformed data will be sent to.
188
+
The [DCR](../essentials/data-collection-rule-overview.md) defines the schema of data that's being sent to the HTTP endpoint and the [transformation](../essentials/data-collection-transformations.md) that will be applied to it before it's sent to the workspace. The DCR also defines the destination workspace and table the transformed data will be sent to.
184
189
185
190
1. In the Azure portal's search box, enter **template** and then select **Deploy a custom template**.
186
191
@@ -199,7 +204,7 @@ The [DCR](../essentials/data-collection-rule-overview.md) defines the schema of
199
204
- `dataCollectionEndpointId`: Identifies the Resource ID of the data collection endpoint.
200
205
- `streamDeclarations`: Defines the columns of the incoming data.
201
206
- `destinations`: Specifies the destination workspace.
202
-
- `dataFlows`: Matches the stream with the destination workspace and specifies the transformation query and the destination table.
207
+
- `dataFlows`: Matches the stream with the destination workspace and specifies the transformation query and the destination table. The output of the destination query is what will be sent to the destination table.
203
208
204
209
```json
205
210
{
@@ -214,12 +219,6 @@ The [DCR](../essentials/data-collection-rule-overview.md) defines the schema of
214
219
},
215
220
"location": {
216
221
"type": "string",
217
-
"defaultValue": "westus2",
218
-
"allowedValues": [
219
-
"westus2",
220
-
"eastus2",
221
-
"eastus2euap"
222
-
],
223
222
"metadata": {
224
223
"description": "Specifies the location in which to create the Data Collection Rule."
225
224
}
@@ -279,7 +278,7 @@ The [DCR](../essentials/data-collection-rule-overview.md) defines the schema of
@@ -305,9 +304,9 @@ The [DCR](../essentials/data-collection-rule-overview.md) defines the schema of
305
304
306
305
:::image type="content" source="media/tutorial-workspace-transformations-api/data-collection-rule-details.png" lightbox="media/tutorial-workspace-transformations-api/data-collection-rule-details.png" alt-text="Screenshot that shows DCR details.":::
307
306
308
-
1. Copy the **Resource ID** for the DCR. You'll use it in the next step.
307
+
1. Copy the **Immutable ID** for the DCR. You'll use it in a later step when you send sample data using the API.
309
308
310
-
:::image type="content" source="media/tutorial-workspace-transformations-api/data-collection-rule-json-view.png" lightbox="media/tutorial-workspace-transformations-api/data-collection-rule-json-view.png" alt-text="Screenshot that shows DCR JSON view.":::
309
+
:::image type="content" source="media/tutorial-logs-ingestion-api/data-collection-rule-json-view.png" lightbox="media/tutorial-workspace-transformations-api/data-collection-rule-json-view.png" alt-text="Screenshot that shows DCR JSON view.":::
311
310
312
311
> [!NOTE]
313
312
> All the properties of the DCR, such as the transformation, might not be displayed in the Azure portal even though the DCR was successfully created with those properties.
@@ -357,6 +356,7 @@ The following PowerShell code sends data to the endpoint by using HTTP REST fund
357
356
#information needed to send data to the DCR endpoint
358
357
$dcrImmutableId = "dcr-000000000000000"; #the immutableId property of the DCR object
359
358
$dceEndpoint = "https://my-dcr-name.westus2-1.ingest.monitor.azure.com"; #the endpoint property of the Data Collection Endpoint object
359
+
$streamName = "Custom-MyTableRawData"; #name of the stream in the DCR that represents the destination table
360
360
361
361
##################
362
362
### Step 1: Obtain a bearer token used later to authenticate against the DCE.
@@ -404,7 +404,7 @@ The following PowerShell code sends data to the endpoint by using HTTP REST fund
0 commit comments