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/custom-logs-migrate.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ If the table that you're targeting with DCR-based log collection fits the criter
34
34
35
35
1. Configure your data collection rule (DCR) following procedures at [Send custom logs to Azure Monitor Logs using Resource Manager templates (preview)](tutorial-logs-ingestion-api.md) or [Add transformation in workspace data collection rule to Azure Monitor using resource manager templates (preview)](tutorial-workspace-transformations-api.md).
36
36
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.
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.
38
38
39
39
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.
# Configure a Log Analytics workspace in Azure Monitor using PowerShell
14
14
15
-
The following sample script configures the workspace to collect multiple types of logs from virtual machines using the [Log Analytics agent](../agents/log-analytics-agent.md).
15
+
The following sample script configures the workspace to collect multiple types of logs from virtual machines by using the [Log Analytics agent](../agents/log-analytics-agent.md).
16
16
17
17
This script performs the following functions:
18
18
19
-
1. Create a workspace
20
-
1. Enable collection of IIS logs from computers with the Windows agent installed
21
-
1. Collect Logical Disk perf counters from Linux computers (% Used Inodes; Free Megabytes; % Used Space; Disk Transfers/sec; Disk Reads/sec; Disk Writes/sec)
22
-
1. Collect syslog events from Linux computers
23
-
1. Collect Error and Warning events from the Application Event Log from Windows computers
24
-
1. Collect Memory Available Mbytes performance counter from Windows computers
25
-
1. Collect a custom log
19
+
1. Create a workspace.
20
+
1. Enable collection of IIS logs from computers with the Windows agent installed.
21
+
1. Collect Logical Disk perf counters from Linux computers (% Used Inodes; Free Megabytes; % Used Space; Disk Transfers/sec; Disk Reads/sec; Disk Writes/sec).
22
+
1. Collect Syslog events from Linux computers.
23
+
1. Collect Error and Warning events from the Application Event Log from Windows computers.
24
+
1. Collect Memory Available Mbytes performance counter from Windows computers.
> The format for the **CustomLogRawJson** parameter which defines the configuration for a custom log can be complex. Use [Get-AzOperationalInsightsDataSource](/powershell/module/az.operationalinsights/get-azoperationalinsightsdatasource) to retrieve the configuration for an existing Custom Log. The **Properties** property is the configuration required for the **CustomLogRawJson** parameter.
66
+
> The format for the `CustomLogRawJson` parameter that defines the configuration for a custom log can be complex. Use [Get-AzOperationalInsightsDataSource](/powershell/module/az.operationalinsights/get-azoperationalinsightsdatasource) to retrieve the configuration for an existing custom log. The `Properties` property is the configuration required for the `CustomLogRawJson` parameter.
67
67
68
-
In the above exampleregexDelimiter was defined as "\\n" for newline. The log delimiter may also be a timestamp. These are the supported formats:
68
+
In the preceding example, `regexDelimiter` was defined as `\\n` for newline. The log delimiter might also be a timestamp. The following table lists the formats that are supported.
69
69
70
-
| Format |Json RegEx format uses two `\\` for every `\` in a standard RegEx so if testing in a RegEx app reduce `\\` to `\`|
70
+
| Format |JSON RegEx format uses two `\\` for every `\` in a standard RegEx, so if testing in a RegEx app, reduce `\\` to `\`|
@@ -82,13 +82,14 @@ In the above example regexDelimiter was defined as "\\n" for newline. The log de
82
82
|`yyyy-MM-ddTHH:mm:ss` <br> The T is a literal letter T | `((\\d{2})|(\\d{4}))-([0-1]\\d)-(([0-3]\\d)|(\\d))T((\\d)|([0-1]\\d)|(2[0-4])):[0-5][0-9]:[0-5][0-9]` |
83
83
84
84
## Troubleshooting
85
-
When you create a workspace that was deleted in the last 14 days and in [soft-delete state](../logs/delete-workspace.md#soft-delete-behavior), the operation could have different outcome depending on your workspace configuration:
86
-
1. If you provide the same workspace name, resource group, subscription and region as in the deleted workspace, your workspace will be recovered including its data, configuration and connected agents.
87
-
2. Workspace name must be unique per resource group. If you use a workspace name that is already exists, also in soft-delete in your resource group, you will get an error *The workspace name 'workspace-name' is not unique*, or *conflict*. To override the soft-delete and permanently delete your workspace and create a new workspace with the same name, follow these steps to recover the workspace first and perform permanent delete:
88
-
*[Recover](../logs/delete-workspace.md#recover-workspace) your workspace
89
-
*[Permanently delete](../logs/delete-workspace.md#permanent-workspace-delete) your workspace
90
-
* Create a new workspace using the same workspace name
85
+
When you create a workspace that was deleted in the last 14 days and is in a [soft-delete state](../logs/delete-workspace.md#soft-delete-behavior), the operation could have a different outcome depending on your workspace configuration. For example:
91
86
87
+
- If you provide the same workspace name, resource group, subscription, and region as in the deleted workspace, your workspace will be recovered. The recovered workspace includes data, configuration, and connected agents.
88
+
- A workspace name must be unique per resource group. If you use a workspace name that already exists and is also in soft delete in your resource group, you'll get an error. The error will state "The workspace name 'workspace-name' is not unique" or "conflict." To override the soft delete, permanently delete your workspace, and create a new workspace with the same name, follow these steps to recover the workspace first and then perform a permanent delete:
89
+
90
+
*[Recover](../logs/delete-workspace.md#recover-workspace) your workspace.
91
+
*[Permanently delete](../logs/delete-workspace.md#permanent-workspace-delete) your workspace.
92
+
* Create a new workspace by using the same workspace name.
92
93
93
94
## Next steps
94
-
*[Review Log Analytics PowerShell cmdlets](/powershell/module/az.operationalinsights/) for additional information on using PowerShell for configuration of Log Analytics.
95
+
[Review Log Analytics PowerShell cmdlets](/powershell/module/az.operationalinsights/) for more information on using PowerShell for configuration of Log Analytics.
title: Save a query in Azure Monitor Log Analytics (preview)
3
-
description: Describes how to save a query in Log Analytics.
3
+
description: This article describes how to save a query in Log Analytics.
4
4
ms.subservice: logs
5
5
ms.topic: article
6
6
author: guywi-ms
@@ -10,44 +10,41 @@ ms.date: 06/22/2022
10
10
---
11
11
12
12
# Save a query in Azure Monitor Log Analytics (preview)
13
-
[Log queries](log-query-overview.md) are requests in Azure Monitor that allow you to process and retrieve data in a Log Analytics workspace. Saving a log queries allows you to:
13
+
[Log queries](log-query-overview.md) are requests in Azure Monitor that you can use to process and retrieve data in a Log Analytics workspace. Saving a log query allows you to:
14
14
15
-
-use the query in all Log Analytics context, including workspace and resource centric.
16
-
-allow other users to run same query.
17
-
-create a library of common queries for your organization.
15
+
-Use the query in all Log Analytics contexts, including workspace and resource centric.
16
+
-Allow other users to run the same query.
17
+
-Create a library of common queries for your organization.
18
18
19
19
## Save options
20
-
When you save a query, it's stored in a query pack which has the following benefits over the previous method of storing the query in a workspace. Saving to a query pack is the preferred method providing the following benefits:
20
+
When you save a query, it's stored in a query pack, which has benefits over the previous method of storing the query in a workspace. Saving to a query pack is the preferred method, and it provides the following benefits:
21
21
22
22
- Easier discoverability with the ability to filter and group queries by different properties.
23
-
- Queries available when using a resource scope in Log Analytics.
24
-
- Make queries available across subscriptions.
25
-
- More data available to describe and categorize the query.
26
-
23
+
- Queries are available when you use a resource scope in Log Analytics.
24
+
- Queries are made available across subscriptions.
25
+
- More data is available to describe and categorize the query.
27
26
28
27
## Save a query
29
28
To save a query to a query pack, select **Save as Log Analytics Query** from the **Save** dropdown in Log Analytics.
[](media/save-query/save-query.png#lightbox)
32
31
33
-
When you save a query to a query pack, the following dialog box is displayed where you can provide values for the query properties. The query properties are used for filtering and grouping of similar queries to help you find the query you're looking for. See [Query properties](queries.md#query-properties) for a detailed description of each property.
32
+
When you save a query to a query pack, the following dialog box appears where you can provide values for the query properties. The query properties are used for filtering and grouping of similar queries to help you find the query you're looking for. For a detailed description of each property, see [Query properties](queries.md#query-properties).
34
33
35
-
Most users should leave the option to **Save to the default query pack** which will save the query in the [default query pack](query-packs.md#default-query-pack). Uncheck this box if there are other query packs in your subscription. See [Query packs in Azure Monitor Logs](query-packs.md) for details on creating a new query pack.
34
+
Most users should leave the option to **Save to the default query pack**, which will save the query in the [default query pack](query-packs.md#default-query-pack). Clear this checkbox if there are other query packs in your subscription. For information on how to create a new query pack, see [Query packs in Azure Monitor Logs](query-packs.md).
[](media/save-query/save-query-dialog.png#lightbox)
38
37
39
38
## Edit a query
40
-
You may want to edit a query that you already saved. This may be to change the query itself or modify any of its properties. After you open an existing query in Log Analytics, you can edit it by selecting **Edit query details** from the **Save** dropdown. This will allow you to save the edited query with the same properties or modify any properties before saving.
41
-
42
-
If you want to save the query with a different name, then select **Save as Log Analytics Query** the same as if you were creating a new query.
39
+
You might want to edit a query that you've already saved. You might want to change the query itself or modify any of its properties. After you open an existing query in Log Analytics, you can edit it by selecting **Edit query details** from the **Save** dropdown. Now you can save the edited query with the same properties or modify any properties before saving.
43
40
41
+
If you want to save the query with a different name, select **Save as Log Analytics Query** as if you were creating a new query.
44
42
45
43
## Save as a legacy query
46
-
Saving as a legacy query is not recommended because of the advantages of query packs listed above. You can save a query to the workspace though to combine it with other queries that were save to the workspace before the release of query packs.
47
-
48
-
To save a legacy query, select **Save as Log Analytics Query** from the **Save** dropdown in Log Analytics. Choose the **Save as Legacy query** option. The only option available will be the legacy category.
44
+
We don't recommend saving as a legacy query because of the advantages of query packs. You can save a query to the workspace to combine it with other queries that were saved to the workspace before the release of query packs.
49
45
46
+
To save a legacy query, select **Save as Log Analytics Query** from the **Save** dropdown in Log Analytics. Choose the **Save as Legacy query** option. The only option available will be the legacy category.
50
47
51
48
## Next steps
52
49
53
-
[Get started with KQL Queries](get-started-queries.md)
50
+
[Get started with KQL queries](get-started-queries.md)
0 commit comments