如何使用 Azure Cli 列出诊断设置目标详细信息

问题描述 投票:0回答:1

我使用以下 Azure CLI 命令列出存储帐户 blob 服务的诊断设置,但它仅列出“日志”和“指标”信息。我还需要“目的地详细信息”。请有人指导我如何使用 Azure CLI 列出诊断设置的

**Destination Details**

{ "id": "/subscriptions/<>/resourcegroups/<>/providers/microsoft.storage/storageaccounts/<>/blobservices/default/providers/microsoft.insights/diagnosticSettings/<>", "logs": [ { "category": "StorageRead", "enabled": true, "retentionPolicy": { "days": 0, "enabled": false } }, { "category": "StorageWrite", "enabled": true, "retentionPolicy": { "days": 0, "enabled": false } }, { "category": "StorageDelete", "enabled": true, "retentionPolicy": { "days": 0, "enabled": false } } ], "metrics": [ { "category": "Capacity", "enabled": false, "retentionPolicy": { "days": 0, "enabled": false } }, { "category": "Transaction", "enabled": false, "retentionPolicy": { "days": 0, "enabled": false } } ], "name": "", "resourceGroup": "", "storageAccountId": "/subscriptions/<>/resourceGroups/<>/providers/Microsoft.Storage/storageAccounts/<>", "type": "Microsoft.Insights/diagnosticSettings", "workspaceId": "/subscriptions/<>/resourceGroups/<>/providers/Microsoft.OperationalInsights/workspaces/<>-ctlz-log-analytics-workspace"

Azure 诊断设置

az monitor diagnostic-settings show --resource '/subscriptions/<subscription>/resourceGroups/<RG name>/providers/Microsoft.Storage/storageAccounts/<storage account name>/blobServices/default' --name '<Diagnostic Settings name>'


    

azure-cli azure-diagnostics
1个回答
0
投票
如何使用 Azure Cli 列出诊断设置目标详细信息

我的诊断设置:

enter image description here

您可以使用下面的 Azure Cli 脚本来获取诊断设置的目标:

$rith=az monitor diagnostic-settings show --resource '/subscriptions/13f616/resourceGroups/cloud-shell-storage-centralindia/providers/Microsoft.Storage/storageAccounts/csg100d0/blobServices/default' --name 'testdiag'| ConvertFrom-Json $test=$rith.workspaceId $dest = $test.Split("/")[-1] $dest

输出:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.