az monitor data-collection rule association

注意

此參考是 Azure CLI 的 monitor-control-service 擴充功能的一部分(2.55.0 版或更高版本)。 擴充功能會在您第一次執行 az monitor data-collection rule association 命令時自動安裝。 深入了解擴充功能。

管理監視控件服務的數據收集規則關聯。

命令

名稱 Description 類型 狀態
az monitor data-collection rule association create

建立關聯。

副檔名 GA
az monitor data-collection rule association delete

刪除關聯。

副檔名 GA
az monitor data-collection rule association list

列出指定數據收集規則的關聯。 和列出指定數據收集端點的關聯。 和列出指定資源的關聯。

副檔名 GA
az monitor data-collection rule association list-by-resource

列出指定資源的關聯。

副檔名 GA
az monitor data-collection rule association show

取得指定的關聯。

副檔名 GA
az monitor data-collection rule association update

更新關聯。

副檔名 GA

az monitor data-collection rule association create

建立關聯。

az monitor data-collection rule association create --association-name
                                                   --resource
                                                   [--data-collection-endpoint-id]
                                                   [--data-collection-rule-id]
                                                   [--description]

範例

建立關聯

az monitor data-collection rule association create --name "myAssociation" --rule-id "/subscriptions/703362b3-f278-4e4b-9179- c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule" --resource "subscriptions/703362b3-f278-4e4b-9179- c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm "

必要參數

--association-name --name -n

關聯的名稱。 名稱不區分大小寫。

--resource --resource-uri

資源的標識碼。

選擇性參數

--data-collection-endpoint-id --endpoint-id

要關聯之數據收集端點的資源標識符。

--data-collection-rule-id --rule-id

要關聯之數據收集規則的資源標識碼。

--description

關聯的描述。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az monitor data-collection rule association delete

刪除關聯。

az monitor data-collection rule association delete --association-name
                                                   --resource
                                                   [--yes]

範例

刪除關聯

az monitor data-collection rule association delete --name "myAssociation" --resource "subscr iptions/703362b3-f278-4e4b-9179- c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm "

必要參數

--association-name --name -n

關聯的名稱。 名稱不區分大小寫。

--resource --resource-uri

資源的標識碼。

選擇性參數

--yes -y

不提示確認。

預設值: False
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az monitor data-collection rule association list

列出指定數據收集規則的關聯。 和列出指定數據收集端點的關聯。 和列出指定資源的關聯。

az monitor data-collection rule association list [--data-collection-endpoint-name]
                                                 [--data-collection-rule-name]
                                                 [--resource]
                                                 [--resource-group]

範例

指定資料收集規則的清單關聯

az monitor data-collection rule association list --rule-name "myCollectionRule" --resource-group "myResourceGroup"

列出指定數據收集端點的關聯

az monitor data-collection rule association list --data-collection-endpoint-name "myDataCollectionEndpointName" --resource-group "myResourceGroup"

列出指定資源的關聯

az monitor data-collection rule association list --resource "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm"

選擇性參數

--data-collection-endpoint-name --endpoint-name

數據收集端點的名稱。 名稱不區分大小寫。

--data-collection-rule-name --rule-name

數據收集規則的名稱。 名稱不區分大小寫。

--resource --resource-uri

資源的標識碼。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az monitor data-collection rule association list-by-resource

列出指定資源的關聯。

az monitor data-collection rule association list-by-resource --resource
                                                             [--max-items]
                                                             [--next-token]

必要參數

--resource --resource-uri

資源的標識碼。

選擇性參數

--max-items

命令輸出中要傳回的項目總數。 如果可用的專案總數超過指定的值,則會在命令的輸出中提供令牌。 若要繼續分頁,請在後續命令的自變數中 --next-token 提供令牌值。

--next-token

標記,指定要開始分頁的位置。 這是先前截斷回應中的令牌值。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az monitor data-collection rule association show

取得指定的關聯。

az monitor data-collection rule association show --association-name
                                                 --resource

範例

取得關聯

az monitor data-collection rule association show --name "myAssociation" --resource "subscrip tions/703362b3-f278-4e4b-9179- c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm "

必要參數

--association-name --name -n

關聯的名稱。 名稱不區分大小寫。

--resource --resource-uri

資源的標識碼。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az monitor data-collection rule association update

更新關聯。

az monitor data-collection rule association update --association-name
                                                   --resource
                                                   [--add]
                                                   [--data-collection-endpoint-id]
                                                   [--data-collection-rule-id]
                                                   [--description]
                                                   [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                                   [--remove]
                                                   [--set]

範例

更新關聯

az monitor data-collection rule association update --name "myAssociation" --rule-id "/subscr iptions/703362b3-f278-4e4b-9179- c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules /myCollectionRule" --resource "subscriptions/703362b3-f278-4e4b-9179- c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm "

必要參數

--association-name --name -n

關聯的名稱。 名稱不區分大小寫。

--resource --resource-uri

資源的標識碼。

選擇性參數

--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例:--add property.listProperty <key=value、string 或 JSON 字串>。

--data-collection-endpoint-id --endpoint-id

要關聯之數據收集端點的資源標識符。

--data-collection-rule-id --rule-id

要關聯之數據收集規則的資源標識碼。

--description

關聯的描述。

--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--remove

從清單中移除屬性或專案。 範例:--remove property.list OR --remove 屬性ToRemove。

--set

指定要設定的屬性路徑和值,以更新物件。 範例:--set property1.property2=。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。