Skip to content

Commit 3a8d082

Browse files
Merge pull request #230373 from bwren/logs-api-python
Add client libraries to Logs ingestion API tutorial
2 parents 6003d1d + 8128cb8 commit 3a8d082

9 files changed

+751
-396
lines changed

articles/azure-monitor/logs/custom-logs-migrate.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ If all of these conditions aren't true, then you can use DCR-based log collectio
3232
## Migration procedure
3333
If the table that you're targeting with DCR-based log collection fits the criteria above, then you must perform the following steps:
3434

35-
1. Configure your data collection rule (DCR) following procedures at [Send custom logs to Azure Monitor Logs using Resource Manager templates](tutorial-logs-ingestion-api.md) or [Add transformation in workspace data collection rule to Azure Monitor using resource manager templates](tutorial-workspace-transformations-api.md).
35+
1. Configure your data collection rule (DCR) following procedures at [Send data to Azure Monitor using Logs ingestion API (Resource Manager templates)](tutorial-logs-ingestion-api.md) or [Add transformation in workspace data collection rule to Azure Monitor using Resource Manager templates](tutorial-workspace-transformations-api.md).
3636

37-
1. If using the Logs ingestion API, also [configure the data collection endpoint (DCE)](tutorial-logs-ingestion-api.md#create-a-data-collection-endpoint) and the agent or component that will be sending data to the API.
37+
1. If using the Logs ingestion API, also [configure the data collection endpoint (DCE)](tutorial-logs-ingestion-api.md#create-data-collection-endpoint) and the agent or component that will be sending data to the API.
3838

3939
1. Issue the following API call against your table. This call is idempotent, so there will be no effect if the table has already been migrated.
4040

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
---
22
title: Logs Ingestion API in Azure Monitor
3-
description: Send data to a Log Analytics workspace by using a REST API.
3+
description: Send data to a Log Analytics workspace using REST API or client libraries.
44
ms.topic: conceptual
55
ms.date: 06/27/2022
66

77
---
88

99
# Logs Ingestion API in Azure Monitor
10+
The Logs Ingestion API in Azure Monitor lets you send data to a Log Analytics workspace using either a [REST API call](#rest-api-call) or [client libraries](#client-libraries). By using this API, you can send data to [supported Azure tables](#supported-tables) or to [custom tables that you create](../logs/create-custom-table.md#create-a-custom-table). You can even [extend the schema of Azure tables with custom columns](../logs/create-custom-table.md#add-or-delete-a-custom-column) to accept additional data.
1011

11-
The Logs Ingestion API in Azure Monitor lets you send data to a Log Analytics workspace from any REST API client. By using this API, you can send data from almost any source to [supported Azure tables](#supported-tables) or to [custom tables that you create](../logs/create-custom-table.md#create-a-custom-table). You can even [extend the schema of Azure tables with custom columns](../logs/create-custom-table.md#add-or-delete-a-custom-column).
12-
13-
> [!NOTE]
14-
> The Logs Ingestion API was previously referred to as the custom logs API.
1512

1613
## Basic operation
1714

1815
Your application sends data to a [data collection endpoint (DCE)](../essentials/data-collection-endpoint-overview.md), which is a unique connection point for your subscription. The payload of your API call includes the source data formatted in JSON. The call:
1916

2017
- Specifies a [data collection rule (DCR)](../essentials/data-collection-rule-overview.md) that understands the format of the source data.
21-
- Potentially filters and transforms it for the target table.
22-
- Directs it to a specific table in a specific workspace.
18+
- Potentially filters and transforms the data for the target table.
19+
- Directs the data to a specific table in a specific workspace.
2320

24-
You can modify the target table and workspace by modifying the DCR without any change to the REST API call or source data.
21+
You can modify the target table and workspace by modifying the DCR without any change to the API call or source data.
2522

2623
:::image type="content" source="media/data-ingestion-api-overview/data-ingestion-api-overview.png" lightbox="media/data-ingestion-api-overview/data-ingestion-api-overview.png" alt-text="Diagram that shows an overview of logs ingestion API.":::
2724

2825
> [!NOTE]
2926
> To migrate solutions from the [Data Collector API](data-collector-api.md), see [Migrate from Data Collector API and custom fields-enabled tables to DCR-based custom logs](custom-logs-migrate.md).
3027
31-
## Supported tables
32-
33-
### Custom tables
28+
## Components
3429

35-
The Logs Ingestion API can send data to any custom table that you create and to certain Azure tables in your Log Analytics workspace. The target table must exist before you can send data to it. Custom tables must have the `_CL` suffix.
30+
The Log ingestion API requires the following components to be created before you can send data. Each of these components must all be located in the same region.
3631

37-
### Azure tables
32+
| Component | Description |
33+
|:---|:---|
34+
| Data collection endpoint (DCE) | The DCE provides an endpoint for the application to send to. A single DCE can support multiple DCRs. |
35+
| Data collection rule (DCR) | [Data collection rules](../essentials/data-collection-rule-overview.md) define data collected by Azure Monitor and specify how and where that data should be sent or stored. The API call must specify a DCR to use. The DCR must understand the structure of the input data and the structure of the target table. If the two don't match, it can include a [transformation](../essentials/data-collection-transformations.md) to convert the source data to match the target table. You can also use the transformation to filter source data and perform any other calculations or conversions.
36+
| Log Analytics workspace | The Log Analytics workspace contains the tables that will receive the data. The target tables are specific in the DCR. See [Support tables](#supported-tables) for the tables that the ingestion API can send to. |
3837

39-
The Logs Ingestion API can send data to the following Azure tables. Other tables may be added to this list as support for them is implemented.
38+
## Supported tables
39+
The following tables can receive data from the ingestion API.
4040

41-
- [CommonSecurityLog](/azure/azure-monitor/reference/tables/commonsecuritylog)
42-
- [SecurityEvents](/azure/azure-monitor/reference/tables/securityevent)
43-
- [Syslog](/azure/azure-monitor/reference/tables/syslog)
44-
- [WindowsEvents](/azure/azure-monitor/reference/tables/windowsevent)
41+
| Tables | Description |
42+
|:---|:---|
43+
| Custom tables | The Logs Ingestion API can send data to any custom table that you create in your Log Analytics workspace. The target table must exist before you can send data to it. Custom tables must have the `_CL` suffix. |
44+
| Azure tables | The Logs Ingestion API can send data to the following Azure tables. Other tables may be added to this list as support for them is implemented.<br><br>- [CommonSecurityLog](/azure/azure-monitor/reference/tables/commonsecuritylog)<br>- [SecurityEvents](/azure/azure-monitor/reference/tables/securityevent)<br>- [Syslog](/azure/azure-monitor/reference/tables/syslog)<br>- [WindowsEvents](/azure/azure-monitor/reference/tables/windowsevent)
4545

4646
> [!NOTE]
4747
> Column names must start with a letter and can consist of up to 45 alphanumeric characters and the characters `_` and `-`. The following are reserved column names: `Type`, `TenantId`, `resource`, `resourceid`, `resourcename`, `resourcetype`, `subscriptionid`, `tenanted`. Custom columns you add to an Azure table must have the suffix `_CF`.
@@ -54,18 +54,19 @@ Authentication for the Logs Ingestion API is performed at the DCE, which uses st
5454

5555
The source data sent by your application is formatted in JSON and must match the structure expected by the DCR. It doesn't necessarily need to match the structure of the target table because the DCR can include a [transformation](../essentials//data-collection-transformations.md) to convert the data to match the table's structure.
5656

57-
## Data collection rule
58-
59-
[Data collection rules](../essentials/data-collection-rule-overview.md) define data collected by Azure Monitor and specify how and where that data should be sent or stored. The REST API call must specify a DCR to use. A single DCE can support multiple DCRs, so you can specify a different DCR for different sources and target tables.
57+
## Client libraries
58+
You can use the following client libraries to send data to the Logs ingestion API.
6059

61-
The DCR must understand the structure of the input data and the structure of the target table. If the two don't match, it can use a [transformation](../essentials/data-collection-transformations.md) to convert the source data to match the target table. You can also use the transformation to filter source data and perform any other calculations or conversions.
60+
- [.NET](/dotnet/api/overview/azure/Monitor.Ingestion-readme)
61+
- [Java](/java/api/overview/azure/monitor-ingestion-readme)
62+
- [JavaScript](/javascript/api/overview/azure/monitor-ingestion-readme)
63+
- [Python](/python/api/overview/azure/monitor-ingestion-readme)
6264

63-
## Send data
6465

65-
To send data to Azure Monitor with the Logs Ingestion API, make a POST call to the DCE over HTTP. Details of the call are described in the following sections.
66+
## REST API call
67+
To send data to Azure Monitor with a REST API call, make a POST call to the DCE over HTTP. Details of the call are described in the following sections.
6668

6769
### Endpoint URI
68-
6970
The endpoint URI uses the following format, where the `Data Collection Endpoint` and `DCR Immutable ID` identify the DCE and DCR. `Stream Name` refers to the [stream](../essentials/data-collection-rule-structure.md#custom-logs) in the DCR that should handle the custom data.
7071

7172
```
@@ -88,16 +89,14 @@ The endpoint URI uses the following format, where the `Data Collection Endpoint`
8889

8990
The body of the call includes the custom data to be sent to Azure Monitor. The shape of the data must be a JSON object or array with a structure that matches the format expected by the stream in the DCR. Additionally, it is important to ensure that the request body is properly encoded in UTF-8 to prevent any issues with data transmission.
9091

91-
## Sample call
9292

93-
For sample data and an API call using the Logs Ingestion API, see either [Send custom logs to Azure Monitor Logs using the Azure portal](tutorial-logs-ingestion-portal.md) or [Send custom logs to Azure Monitor Logs using Resource Manager templates](tutorial-logs-ingestion-api.md).
9493

9594
## Limits and restrictions
9695

9796
For limits related to the Logs Ingestion API, see [Azure Monitor service limits](../service-limits.md#logs-ingestion-api).
9897

9998
## Next steps
10099

101-
- [Walk through a tutorial sending custom logs using the Azure portal](tutorial-logs-ingestion-portal.md)
100+
- [Walk through a tutorial configuring the i using the Azure portal](tutorial-logs-ingestion-portal.md)
102101
- [Walk through a tutorial sending custom logs using Resource Manager templates and REST API](tutorial-logs-ingestion-api.md)
103102
- Get guidance on using the client libraries for the Logs ingestion API 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), or [Python](/python/api/overview/azure/monitor-ingestion-readme).
32 Bytes
Loading

0 commit comments

Comments
 (0)