Skip to content

Commit 8fa9236

Browse files
authored
Merge pull request #107311 from nachoalonsoportillo/patch-6
Complete truncated sentence
2 parents da7c356 + 9cfc426 commit 8fa9236

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

articles/azure-monitor/logs/tutorial-logs-ingestion-portal.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.service: azure-monitor
1111
---
1212

1313
# Tutorial: Send data to Azure Monitor Logs with Logs ingestion API (Azure portal)
14-
The [Logs Ingestion API](logs-ingestion-api-overview.md) in Azure Monitor allows you to send external data to a Log Analytics workspace with a REST API. This tutorial uses the Azure portal to walk through configuration of a new table and a sample application to send log data to Azure Monitor. The sample application collects entries from a text file and
14+
The [Logs Ingestion API](logs-ingestion-api-overview.md) in Azure Monitor allows you to send external data to a Log Analytics workspace with a REST API. This tutorial uses the Azure portal to walk through configuration of a new table and a sample application to send log data to Azure Monitor. The sample application collects entries from a text file and either converts the plain log to JSON format generating a resulting .json file, or sends the content to the data collection endpoint.
1515

1616
> [!NOTE]
1717
> This tutorial uses the Azure portal to configure the components to support the Logs ingestion API. See [Tutorial: Send data to Azure Monitor using Logs ingestion API (Resource Manager templates)](tutorial-logs-ingestion-api.md) for a similar tutorial that uses Azure Resource Manager templates to configure these components and that has sample code for client libraries for [.NET](/dotnet/api/overview/azure/Monitor.Ingestion-readme), [Java](/java/api/overview/azure/monitor-ingestion-readme), [JavaScript](/javascript/api/overview/azure/monitor-ingestion-readme), and [Python](/python/api/overview/azure/monitor-ingestion-readme).
@@ -95,7 +95,9 @@ Before you can send data to the workspace, you need to create the custom table w
9595
:::image type="content" source="media/tutorial-logs-ingestion-portal/custom-log-table-name.png" lightbox="media/tutorial-logs-ingestion-portal/custom-log-table-name.png" alt-text="Screenshot that shows the custom log table name.":::
9696

9797
## Parse and filter sample data
98-
Instead of directly configuring the schema of the table, you can upload a file with a sample JSON array of data through the portal, and Azure Monitor will set the schema automatically. The sample JSON file must contain one or more log records structured as an array, in the same way they data is sent in the body of an HTTP request of the logs ingestion API call.
98+
Instead of directly configuring the schema of the table, you can upload a file with a sample JSON array of data through the portal, and Azure Monitor will set the schema automatically. The sample JSON file must contain one or more log records structured as an array, in the same way the data is sent in the body of an HTTP request of the logs ingestion API call.
99+
100+
1. Follow the instructions in [generate sample data](#generate-sample-data) to create the *data_sample.json* file.
99101

100102
1. Select **Browse for files** and locate the *data_sample.json* file that you previously created.
101103

@@ -128,10 +130,10 @@ Instead of directly configuring the schema of the table, you can upload a file w
128130
' ' *
129131
' ' *
130132
' [' * '] "' RequestType:string
131-
" " Resource:string
132-
" " *
133+
' ' Resource:string
134+
' ' *
133135
'" ' ResponseCode:int
134-
" " *
136+
' ' *
135137
```
136138
137139
1. Select **Run** to view the results. This action extracts the contents of `RawData` into the separate columns `ClientIP`, `RequestType`, `Resource`, and `ResponseCode`.
@@ -143,16 +145,17 @@ Instead of directly configuring the schema of the table, you can upload a file w
143145
```kusto
144146
source
145147
| extend TimeGenerated = todatetime(Time)
146-
| parse kind = regex RawData with *
147-
':"'
148+
| parse RawData with
148149
ClientIP:string
149-
" - -" * '"'
150-
RequestType:string
151-
' '
152-
Resource:string
153-
" " *
150+
' ' *
151+
' ' *
152+
' [' * '] "' RequestType:string
153+
' ' Resource:string
154+
' ' *
154155
'" ' ResponseCode:int
155-
" " *
156+
' ' *
157+
| project-away Time, RawData
158+
| where ResponseCode != 200
156159
```
157160
158161
1. Select **Run** to view the results.
@@ -255,7 +258,7 @@ The following PowerShell script generates sample data to configure the custom ta
255258
$payload += $log_entry
256259
}
257260
# Write resulting payload to file
258-
New-Item -Path $Output -ItemType "file" -Value ($payload | ConvertTo-Json) -Force
261+
New-Item -Path $Output -ItemType "file" -Value ($payload | ConvertTo-Json -AsArray) -Force
259262
260263
} else {
261264
############
@@ -836,6 +839,6 @@ You can use the following sample data for the tutorial. Alternatively, you can u
836839
837840
## Next steps
838841
839-
- [Complete a similar tutorial by using the Azure portal](tutorial-logs-ingestion-api.md)
842+
- [Complete a similar tutorial by using ARM templates](tutorial-logs-ingestion-api.md)
840843
- [Read more about custom logs](logs-ingestion-api-overview.md)
841844
- [Learn more about writing transformation queries](../essentials//data-collection-transformations.md)

0 commit comments

Comments
 (0)