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
title: Collect text logs with Azure Monitor agent (preview)
2
+
title: Collect text and IIS logs with Azure Monitor agent (preview)
3
3
description: Configure collection of filed-based text logs using a data collection rule on virtual machines with the Azure Monitor agent.
4
4
ms.topic: conceptual
5
5
ms.date: 04/08/2022
6
6
7
7
---
8
8
9
-
# Collect text logs with Azure Monitor agent (preview)
10
-
This tutorial shows you how to configure the collection of file-based text logswith the [Azure Monitor agent](azure-monitor-agent-overview.md) and sending the collected data to a custom table in a Log Analytics workspace. This feature uses a [data collection rule](../essentials/data-collection-rule-overview.md) that you can use to define the structure of the log file and its target table.
9
+
# Collect text and IIS logs with Azure Monitor agent (preview)
10
+
This articles describes how to configure the collection of file-based text logs, including logs generated by IIS on Windows computers, with the [Azure Monitor agent](azure-monitor-agent-overview.md). This feature uses a [data collection rule](../essentials/data-collection-rule-overview.md) that you can use to define the structure of the log file and its target table.
11
11
12
12
> [!NOTE]
13
13
> This feature is currently in public preview and isn't completely implemented in the Azure portal. This tutorial uses Azure Resource Manager templates for steps that can't yet be performed with the portal.
14
14
15
-
In this tutorial, you learn to:
16
-
17
-
> [!div class="checklist"]
18
-
> * Create a custom table in a Log Analytics workspace.
19
-
> * Create a data collection endpoint to receive data from an agent.
20
-
> * Create a data collection rule that collects data from both a custom text log file.
21
-
> * Create an association to apply the data collection rule to agents.
22
15
## Prerequisites
23
-
To complete this tutorial, you need the following:
16
+
To complete this procedure, you need the following:
24
17
25
18
- Log Analytics workspace where you have at least [contributor rights](../logs/manage-access.md#manage-access-using-azure-permissions) .
26
19
-[Permissions to create Data Collection Rule objects](/azure/azure-monitor/essentials/data-collection-rule-overview#permissions) in the workspace.
@@ -33,6 +26,7 @@ The log file must meet the following criteria to be collected by this feature:
33
26
- Each entry in the log file must be delineated with an [ISO 8601 formatted](https://www.iso.org/standard/40874.html) time stamp or an end of line.
34
27
- The log file must not allow circular logging, log rotation where the file is overwritten with new entries, or the file is renamed and the same file name is reused for continued logging.
35
28
29
+
##
36
30
37
31
## Steps to collect text logs
38
32
The steps to configure log collection are as follows. The detailed steps for each are provided in the sections below:
@@ -45,7 +39,10 @@ The steps to configure log collection are as follows. The detailed steps for eac
45
39
## Create new table in Log Analytics workspace
46
40
The custom table must be created before you can send data to it. When you create the table, you provide its name and a definition for each of its columns.
47
41
48
-
Use the **Tables - Update** API to create the table with the PowerShell code below. This code creates a table called *MyTable_CL* with two columns. You can modify this schema to collect a different table.
42
+
>[!NOTE]
43
+
> This step isn't required to collect an IIS log. The table [W3CIISLog](/azure/azure-monitor/reference/tables/w3ciislog) will be used for IIS logs.
44
+
45
+
Use the **Tables - Update** API to create the table with the PowerShell code below. This code creates a table called *MyTable_CL* with two columns. Modify this schema to collect a different table.
49
46
50
47
> [!IMPORTANT]
51
48
> Custom tables must use a suffix of *_CL*.
@@ -96,7 +93,6 @@ A [data collection endpoint (DCE)](../essentials/data-collection-endpoint-overvi
96
93
97
94
:::image type="content" source="../logs/media/tutorial-ingestion-time-transformations-api/edit-template.png" lightbox="../logs/media/tutorial-ingestion-time-transformations-api/edit-template.png" alt-text="Screenshot that shows portal blade to edit Resource Manager template.":::
@@ -143,6 +139,7 @@ A [data collection endpoint (DCE)](../essentials/data-collection-endpoint-overvi
143
139
}
144
140
```
145
141
142
+
146
143
4. On the **Custom deployment** screen, specify a **Subscription** and **Resource group** to store the data collection rule and then provide values a **Name** for the data collection endpoint. The **Location** should be the same location as the workspace. The **Region** will already be populated and is used for the location of the data collection endpoint.
147
144
148
145
:::image type="content" source="../logs/media/tutorial-ingestion-time-transformations-api/custom-deployment-values.png" lightbox="../logs/media/tutorial-ingestion-time-transformations-api/custom-deployment-values.png" alt-text="Screenshot that shows portal blade to edit custom deployment values for data collection endpoint.":::
@@ -173,7 +170,7 @@ The [data collection rule (DCR)](../essentials/data-collection-rule-overview.md)
173
170
174
171
:::image type="content" source="../logs/media/tutorial-ingestion-time-transformations-api/build-custom-template.png" lightbox="../logs/media/tutorial-ingestion-time-transformations-api/build-custom-template.png" alt-text="Screenshot that shows portal blade to build template in the editor.":::
175
172
176
-
3. Paste the Resource Manager template below into the editor and then change the following values:
173
+
3. Paste on of the Resource Manager templates below into the editor and then change the following values:
177
174
178
175
You may choose to modify the following details in the DCR defined in this template:
179
176
@@ -186,6 +183,7 @@ The [data collection rule (DCR)](../essentials/data-collection-rule-overview.md)
186
183
187
184
:::image type="content" source="../logs/media/tutorial-ingestion-time-transformations-api/edit-template.png" lightbox="../logs/media/tutorial-ingestion-time-transformations-api/edit-template.png" alt-text="Screenshot that shows portal blade to edit Resource Manager template.":::
188
185
186
+
**Data collection rule for text log**
189
187
190
188
```json
191
189
{
@@ -235,7 +233,7 @@ The [data collection rule (DCR)](../essentials/data-collection-rule-overview.md)
5. On the **Custom deployment** screen, specify a **Subscription** and **Resource group** to store the data collection rule and then provide values defined in the template. This includes a **Name** for the data collection rule and the **Workspace Resource ID** and **Endpoint Resource ID**. The **Location** should be the same location as the workspace. The **Region** will already be populated and is used for the location of the data collection rule.
322
415
323
416
:::image type="content" source="media/data-collection-text-log/custom-deployment-values.png" lightbox="media/data-collection-text-log/custom-deployment-values.png" alt-text="Screenshot that shows portal blade to edit custom deployment values for data collection rule.":::
0 commit comments