diff --git a/src/azure-cli/azure/cli/command_modules/monitor/_help.py b/src/azure-cli/azure/cli/command_modules/monitor/_help.py index 90d9f97b035..ab6b4c85ab4 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/_help.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/_help.py @@ -1303,7 +1303,7 @@ short-summary: Create a saved search for a given workspace. examples: - name: Create a saved search for a given workspace. - text: az monitor log-analytics workspace saved-search create -g MyRG --workspace-name MyWS -n MySavedSearch --category Test1 --display-name TestSavedSearch -q "AzureActivity | summarize count() by bin(timestamp, 1h)" --fa myfun --fp "a:string = value" + text: az monitor log-analytics workspace saved-search create -g MyRG --workspace-name MyWS -n MySavedSearch --category Test1 --display-name TestSavedSearch -q "AzureActivity | summarize count() by bin(TimeGenerated, 1h)" --fa myfun --fp "a:string = value" """ helps['monitor log-analytics workspace saved-search update'] = """ @@ -1311,7 +1311,7 @@ short-summary: Update a saved search for a given workspace. examples: - name: Update a saved search for a given workspace. - text: az monitor log-analytics workspace saved-search update -g MyRG --workspace-name MyWS -n MySavedSearch --category Test1 --display-name TestSavedSearch -q "AzureActivity | summarize count() by bin(timestamp, 1h)" --fa myfun --fp "a:string = value" + text: az monitor log-analytics workspace saved-search update -g MyRG --workspace-name MyWS -n MySavedSearch --category Test1 --display-name TestSavedSearch -q "AzureActivity | summarize count() by bin(TimeGenerated, 1h)" --fa myfun --fp "a:string = value" """ helps['monitor log-analytics workspace saved-search list'] = """ @@ -1337,6 +1337,14 @@ helps['monitor log-analytics workspace data-export create'] = """ type: command short-summary: Create a data export rule for a given workspace. +long-summary: | + For more information, see + https://docs.microsoft.com/en-us/azure/azure-monitor/platform/logs-data-export. +parameters: + - name: --tables -t + short-summary: An array of tables to export. + populator-commands: + - "`az monitor log-analytics workspace table list`" examples: - name: Create a data export rule for a given workspace. text: az monitor log-analytics workspace data-export create -g MyRG --workspace-name MyWS -n MyDataExport --destination {sa_id_1} --enable -t {table_name} @@ -1345,6 +1353,14 @@ helps['monitor log-analytics workspace data-export update'] = """ type: command short-summary: Update a data export rule for a given workspace. +long-summary: | + For more information, see + https://docs.microsoft.com/en-us/azure/azure-monitor/platform/logs-data-export. +parameters: + - name: --tables -t + short-summary: An array of tables to export. + populator-commands: + - "`az monitor log-analytics workspace table list`" examples: - name: Update a data export rule for a given workspace. text: az monitor log-analytics workspace data-export update -g MyRG --workspace-name MyWS -n MyDataExport --destination {namespace_id} -t {table_name} --enable false diff --git a/src/azure-cli/azure/cli/command_modules/monitor/_params.py b/src/azure-cli/azure/cli/command_modules/monitor/_params.py index d02d0b4021c..be1e3fd1dbc 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/_params.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/_params.py @@ -442,7 +442,7 @@ def load_arguments(self, _): c.argument('data_export_name', options_list=['--name', '-n'], help="Name of the data export rule") c.argument('workspace_name', options_list='--workspace-name') c.argument('table_names', nargs='+', options_list=['--tables', '-t'], - help='An array of tables to export. if --export-all-tables is true, this argument should not be provided.') + help='An array of tables to export.') c.argument('destination', validator=process_workspace_data_export_destination, help='The destination resource ID. It should be a storage account, an event hub namespace or an event hub. ' 'If event hub namespace is provided, event hub would be created for each table automatically.') diff --git a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_monitor_log_analytics_workspace_saved_search.yaml b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_monitor_log_analytics_workspace_saved_search.yaml index a30590e0c34..68ed06e42c6 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_monitor_log_analytics_workspace_saved_search.yaml +++ b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_monitor_log_analytics_workspace_saved_search.yaml @@ -13,15 +13,15 @@ interactions: ParameterSetName: - -g -n --tags User-Agent: - - python/3.7.8 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.18.0 + - python/3.8.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.19.0 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001?api-version=2020-10-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_workspace_saved_search000001","name":"cli_test_monitor_workspace_saved_search000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-01-15T10:01:04Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_workspace_saved_search000001","name":"cli_test_monitor_workspace_saved_search000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-02-10T06:54:44Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -30,7 +30,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 15 Jan 2021 10:01:06 GMT + - Wed, 10 Feb 2021 06:54:47 GMT expires: - '-1' pragma: @@ -63,23 +63,23 @@ interactions: ParameterSetName: - -g -n --tags User-Agent: - - AZURECLI/2.18.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.19.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-08-01 response: body: string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": - \"fd5b8539-6e1f-4546-b250-e3711d487d06\",\r\n \"provisioningState\": \"Creating\",\r\n + \"5b7806c9-25ce-43b6-afde-6d8f96534640\",\r\n \"provisioningState\": \"Creating\",\r\n \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"maxCapacityReservationLevel\": - 3000,\r\n \"lastSkuUpdate\": \"Fri, 15 Jan 2021 10:01:15 GMT\"\r\n },\r\n + 3000,\r\n \"lastSkuUpdate\": \"Wed, 10 Feb 2021 06:54:56 GMT\"\r\n },\r\n \ \"retentionInDays\": 30,\r\n \"features\": {\r\n \"legacy\": 0,\r\n \ \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n - \ \"quotaNextResetTime\": \"Fri, 15 Jan 2021 11:00:00 GMT\",\r\n \"dataIngestionStatus\": + \ \"quotaNextResetTime\": \"Wed, 10 Feb 2021 16:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \ \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"createdDate\": - \"Fri, 15 Jan 2021 10:01:15 GMT\",\r\n \"modifiedDate\": \"Fri, 15 Jan - 2021 10:01:15 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001/providers/microsoft.operationalinsights/workspaces/clitest000002\",\r\n + \"Wed, 10 Feb 2021 06:54:56 GMT\",\r\n \"modifiedDate\": \"Wed, 10 Feb + 2021 06:54:56 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001/providers/microsoft.operationalinsights/workspaces/clitest000002\",\r\n \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \ \"location\": \"eastus\",\r\n \"tags\": {\r\n \"clitest\": \"myron\"\r\n \ }\r\n}" @@ -91,7 +91,7 @@ interactions: content-type: - application/json date: - - Fri, 15 Jan 2021 10:01:18 GMT + - Wed, 10 Feb 2021 06:54:57 GMT pragma: - no-cache server: @@ -102,7 +102,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1181' + - '1198' x-powered-by: - ASP.NET - ASP.NET @@ -123,23 +123,23 @@ interactions: ParameterSetName: - -g -n --tags User-Agent: - - AZURECLI/2.18.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.19.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-08-01 response: body: string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": - \"fd5b8539-6e1f-4546-b250-e3711d487d06\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \"5b7806c9-25ce-43b6-afde-6d8f96534640\",\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"maxCapacityReservationLevel\": - 3000,\r\n \"lastSkuUpdate\": \"Fri, 15 Jan 2021 10:01:15 GMT\"\r\n },\r\n + 3000,\r\n \"lastSkuUpdate\": \"Wed, 10 Feb 2021 06:54:56 GMT\"\r\n },\r\n \ \"retentionInDays\": 30,\r\n \"features\": {\r\n \"legacy\": 0,\r\n \ \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n - \ \"quotaNextResetTime\": \"Fri, 15 Jan 2021 11:00:00 GMT\",\r\n \"dataIngestionStatus\": + \ \"quotaNextResetTime\": \"Wed, 10 Feb 2021 16:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \ \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"createdDate\": - \"Fri, 15 Jan 2021 10:01:15 GMT\",\r\n \"modifiedDate\": \"Fri, 15 Jan - 2021 10:01:19 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001/providers/microsoft.operationalinsights/workspaces/clitest000002\",\r\n + \"Wed, 10 Feb 2021 06:54:56 GMT\",\r\n \"modifiedDate\": \"Wed, 10 Feb + 2021 06:54:58 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001/providers/microsoft.operationalinsights/workspaces/clitest000002\",\r\n \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \ \"location\": \"eastus\",\r\n \"tags\": {\r\n \"clitest\": \"myron\"\r\n \ }\r\n}" @@ -151,7 +151,7 @@ interactions: content-type: - application/json date: - - Fri, 15 Jan 2021 10:01:50 GMT + - Wed, 10 Feb 2021 06:55:29 GMT pragma: - no-cache server: @@ -191,12 +191,12 @@ interactions: ParameterSetName: - -g --workspace-name -n --category --display-name -q --fa --fp --tags User-Agent: - - AZURECLI/2.18.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.19.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest?api-version=2020-08-01 response: body: - string: '{"id":"subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest","etag":"W/\"datetime''2021-01-15T10%3A01%3A53.2257877Z''\"","properties":{"Category":"cli","DisplayName":"myclitest","Query":"Heartbeat + string: '{"id":"subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest","etag":"W/\"datetime''2021-02-10T06%3A55%3A32.3290044Z''\"","properties":{"Category":"cli","DisplayName":"myclitest","Query":"Heartbeat | getschema","Tags":[{"Name":"a","Value":"b"},{"Name":"c","Value":"d"}],"FunctionAlias":"myfun","FunctionParameters":"a:string = value","Version":2}}' headers: @@ -207,7 +207,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 15 Jan 2021 10:01:53 GMT + - Wed, 10 Feb 2021 06:55:31 GMT expires: - '-1' pragma: @@ -223,7 +223,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1183' + - '1195' x-powered-by: - ASP.NET status: @@ -243,12 +243,12 @@ interactions: ParameterSetName: - -g --workspace-name -n User-Agent: - - AZURECLI/2.18.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.19.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest?api-version=2020-08-01 response: body: - string: '{"id":"subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest","etag":"W/\"datetime''2021-01-15T10%3A01%3A53.2257877Z''\"","properties":{"Category":"cli","DisplayName":"myclitest","Query":"Heartbeat + string: '{"id":"subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest","etag":"W/\"datetime''2021-02-10T06%3A55%3A32.3290044Z''\"","properties":{"Category":"cli","DisplayName":"myclitest","Query":"Heartbeat | getschema","Tags":[{"Name":"a","Value":"b"},{"Name":"c","Value":"d"}],"FunctionAlias":"myfun","FunctionParameters":"a:string = value","Version":2}}' headers: @@ -259,7 +259,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 15 Jan 2021 10:01:54 GMT + - Wed, 10 Feb 2021 06:55:32 GMT expires: - '-1' pragma: @@ -293,12 +293,12 @@ interactions: ParameterSetName: - -g --workspace-name User-Agent: - - AZURECLI/2.18.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.19.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches?api-version=2020-08-01 response: body: - string: '{"__metadata":{},"value":[{"id":"subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest","etag":"W/\"datetime''2021-01-15T10%3A01%3A53.2257877Z''\"","properties":{"Category":"cli","DisplayName":"myclitest","Query":"Heartbeat + string: '{"__metadata":{},"value":[{"id":"subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest","etag":"W/\"datetime''2021-02-10T06%3A55%3A32.3290044Z''\"","properties":{"Category":"cli","DisplayName":"myclitest","Query":"Heartbeat | getschema","Tags":[{"Name":"a","Value":"b"},{"Name":"c","Value":"d"}],"FunctionAlias":"myfun","FunctionParameters":"a:string = value","Version":2},"name":"clitest","type":"Microsoft.OperationalInsights/savedSearches"},{"id":"subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/LogManagement(clitest000002)_LogManagement|AllEvents","properties":{"DisplayName":"All Events","Category":"Log Management","Query":"Event | sort by TimeGenerated @@ -506,7 +506,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 15 Jan 2021 10:01:55 GMT + - Wed, 10 Feb 2021 06:55:35 GMT expires: - '-1' pragma: @@ -540,12 +540,12 @@ interactions: ParameterSetName: - -g --workspace-name -n --category --display-name -q --fa --fp --tags User-Agent: - - AZURECLI/2.18.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.19.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest?api-version=2020-08-01 response: body: - string: '{"id":"subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest","etag":"W/\"datetime''2021-01-15T10%3A01%3A53.2257877Z''\"","properties":{"Category":"cli","DisplayName":"myclitest","Query":"Heartbeat + string: '{"id":"subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest","etag":"W/\"datetime''2021-02-10T06%3A55%3A32.3290044Z''\"","properties":{"Category":"cli","DisplayName":"myclitest","Query":"Heartbeat | getschema","Tags":[{"Name":"a","Value":"b"},{"Name":"c","Value":"d"}],"FunctionAlias":"myfun","FunctionParameters":"a:string = value","Version":2}}' headers: @@ -556,7 +556,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 15 Jan 2021 10:01:57 GMT + - Wed, 10 Feb 2021 06:55:37 GMT expires: - '-1' pragma: @@ -577,9 +577,9 @@ interactions: code: 200 message: OK - request: - body: '{"etag": "W/\"datetime''2021-01-15T10%3A01%3A53.2257877Z''\"", "properties": + body: '{"etag": "W/\"datetime''2021-02-10T06%3A55%3A32.3290044Z''\"", "properties": {"category": "cli2", "displayName": "myclitest2", "query": "AzureActivity | - summarize count() by bin(timestamp, 1h)", "functionAlias": "myfun2", "functionParameters": + summarize count() by bin(TimeGenerated, 1h)", "functionAlias": "myfun2", "functionParameters": "a2:string = value", "tags": [{"name": "a", "value": "c"}, {"name": "f", "value": "e"}]}}' headers: @@ -592,29 +592,29 @@ interactions: Connection: - keep-alive Content-Length: - - '331' + - '335' Content-Type: - application/json ParameterSetName: - -g --workspace-name -n --category --display-name -q --fa --fp --tags User-Agent: - - AZURECLI/2.18.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.19.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest?api-version=2020-08-01 response: body: - string: '{"id":"subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest","etag":"W/\"datetime''2021-01-15T10%3A02%3A00.1048926Z''\"","properties":{"Category":"cli2","DisplayName":"myclitest2","Query":"AzureActivity - | summarize count() by bin(timestamp, 1h)","Tags":[{"Name":"a","Value":"c"},{"Name":"f","Value":"e"}],"FunctionAlias":"myfun2","FunctionParameters":"a2:string + string: '{"id":"subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest","etag":"W/\"datetime''2021-02-10T06%3A55%3A38.6002037Z''\"","properties":{"Category":"cli2","DisplayName":"myclitest2","Query":"AzureActivity + | summarize count() by bin(TimeGenerated, 1h)","Tags":[{"Name":"a","Value":"c"},{"Name":"f","Value":"e"}],"FunctionAlias":"myfun2","FunctionParameters":"a2:string = value","Version":2}}' headers: cache-control: - no-cache content-length: - - '565' + - '569' content-type: - application/json; charset=utf-8 date: - - Fri, 15 Jan 2021 10:01:59 GMT + - Wed, 10 Feb 2021 06:55:38 GMT expires: - '-1' pragma: @@ -630,7 +630,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1199' x-powered-by: - ASP.NET status: @@ -652,7 +652,7 @@ interactions: ParameterSetName: - -g --workspace-name -n -y User-Agent: - - AZURECLI/2.18.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.19.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest?api-version=2020-08-01 response: @@ -664,7 +664,7 @@ interactions: content-length: - '0' date: - - Fri, 15 Jan 2021 10:02:02 GMT + - Wed, 10 Feb 2021 06:55:42 GMT expires: - '-1' pragma: @@ -676,7 +676,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14995' + - '14997' x-powered-by: - ASP.NET status: @@ -696,7 +696,7 @@ interactions: ParameterSetName: - -g --workspace-name -n User-Agent: - - AZURECLI/2.18.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.19.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.7 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_monitor_workspace_saved_search000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/savedSearches/clitest?api-version=2020-08-01 response: @@ -711,7 +711,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 15 Jan 2021 10:02:03 GMT + - Wed, 10 Feb 2021 06:55:43 GMT expires: - '-1' pragma: diff --git a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_log_analytics_workspace.py b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_log_analytics_workspace.py index 0c6c3614890..707c99dd25f 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_log_analytics_workspace.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_log_analytics_workspace.py @@ -321,7 +321,7 @@ def test_monitor_log_analytics_workspace_saved_search(self, resource_group): 'category': 'cli', 'category_2': 'cli2', 'query': "Heartbeat | getschema", - 'query_2': "AzureActivity | summarize count() by bin(timestamp, 1h)", + 'query_2': "AzureActivity | summarize count() by bin(TimeGenerated, 1h)", 'display_name': 'myclitest', 'display_name_2': 'myclitest2', 'function_alias': 'myfun',