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-custom-logs-api.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -340,6 +340,12 @@ Once the data collection rule has been created, the application needs to be give
340
340
## Send sample data
341
341
The following PowerShell code sends data to the endpoint using HTTP REST fundamentals.
342
342
343
+
1. Run the following PowerShell command which adds a required assembly for the script.
344
+
345
+
```powershell
346
+
Add-Type -AssemblyName System.Web
347
+
```
348
+
343
349
1. Replace the parameters in the *step 0* section with values from the resources that you just created. You may also want to replace the sample data in the *step 2* section with your own.
344
350
345
351
```powershell
@@ -364,8 +370,6 @@ The following PowerShell code sends data to the endpoint using HTTP REST fundame
### If the above line throws an 'Unable to find type [System.Web.HttpUtility].' error, execute the line below separately from the rest of the code
368
-
# Add-Type -AssemblyName System.Web
369
373
370
374
##################
371
375
### Step 2: Load up some sample data.
@@ -427,9 +431,6 @@ API limits have been exceeded. The limits are currently set to 500MB of data/min
427
431
### Script returns error code 503
428
432
Ensure that you have the correct permissions for your application to the DCR. You may also need to wait up to 30 minutes for permissions to propagate.
429
433
430
-
### Script returns error `Unable to find type [System.Web.HttpUtility]`
431
-
Run the last line in section 1 of the script for a fix and execute it directly. Executing it uncommented as part of the script will not resolve the issue. The command must be executed separately.
432
-
433
434
### You don't receive an error, but data doesn't appear in the workspace
434
435
The data may take some time to be ingested, especially if this is the first time data is being sent to a particular table. It shouldn't take longer than 15 minutes.
Copy file name to clipboardExpand all lines: articles/azure-monitor/logs/tutorial-custom-logs.md
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,13 @@ A [data collection endpoint (DCE)](../essentials/data-collection-endpoint-overvi
73
73
## Generate sample data
74
74
The following PowerShell script both generates sample data to configure the custom table and sends sample data to the custom logs API to test the configuration.
75
75
76
-
1. Update the values of `$tenantId`, `$appId`, and `$appSecret` with the values you noted for **Directory (tenant) ID**, **Application (client) ID**, and secret **Value** and then save with the file name *LogGenerator.ps1*.
76
+
1. Run the following PowerShell command which adds a required assembly for the script.
77
+
78
+
```powershell
79
+
Add-Type -AssemblyName System.Web
80
+
```
81
+
82
+
2. Update the values of `$tenantId`, `$appId`, and `$appSecret` with the values you noted for **Directory (tenant) ID**, **Application (client) ID**, and secret **Value** and then save with the file name *LogGenerator.ps1*.
## If the above line throws an 'Unable to find type [System.Web.HttpUtility].' error, execute the line below separately from the rest of the code
149
-
# Add-Type -AssemblyName System.Web
150
154
151
155
## Generate and send some data
152
156
foreach ($line in $file_data) {
@@ -173,16 +177,14 @@ The following PowerShell script both generates sample data to configure the cust
173
177
}
174
178
```
175
179
176
-
2. Copy the sample log data from [sample data](#sample-data) or copy your own Apache log data into a file called *sample_access.log*. Run the script using the following command to read this data and create a JSON file called *data_sample.json* that you can send to the custom logs API.
180
+
3. Copy the sample log data from [sample data](#sample-data) or copy your own Apache log data into a file called *sample_access.log*.
3. Run the script using the following command to read this data and create a JSON file called *data_sample.json* that you can send to the custom logs API.
186
+
4. Run the script using the following command to read this data and create a JSON file called *data_sample.json* that you can send to the custom logs API.
183
187
184
-
:::image type="content" source="media/tutorial-custom-logs/new-custom-log.png" lightbox="media/tutorial-custom-logs/new-custom-log.png" alt-text="Screenshot showing new DCR-based custom log.":::
185
-
186
188
## Add custom log table
187
189
Before you can send data to the workspace, you need to create the custom table that the data will be sent to.
188
190
@@ -317,7 +319,7 @@ Allow at least 30 minutes for the configuration to take effect. You may also exp
317
319
1. Run the following command providing the values that you collected for your data collection rule and data collection endpoint. The script will start ingesting data by placing calls to the API at pace of approximately 1 record per second.
2. From Log Analytics, query your newly created table to verify that data arrived and if it is transformed properly.
@@ -336,9 +338,6 @@ API limits have been exceeded. The limits are currently set to 500MB of data/min
336
338
### Script returns error code 503
337
339
Ensure that you have the correct permissions for your application to the DCR. You may also need to wait up to 30 minutes for permissions to propagate.
338
340
339
-
### Script returns error `Unable to find type [System.Web.HttpUtility]`
340
-
Run the last line in section 1 of the script for a fix and execute it directly. Executing it uncommented as part of the script will not resolve the issue. The command must be executed separately.
341
-
342
341
### You don't receive an error, but data doesn't appear in the workspace
343
342
The data may take some time to be ingested, especially if this is the first time data is being sent to a particular table. It shouldn't take longer than 15 minutes.
0 commit comments