az monitor data-collection rule performance-counter

注意

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

管理記錄性能計數器數據源。

命令

名稱 Description 類型 狀態
az monitor data-collection rule performance-counter add

新增記錄性能計數器數據源。

副檔名 GA
az monitor data-collection rule performance-counter delete

刪除記錄性能計數器數據源。

副檔名 GA
az monitor data-collection rule performance-counter list

列出記錄性能計數器數據源。

副檔名 GA
az monitor data-collection rule performance-counter show

顯示記錄性能計數器數據源。

副檔名 GA
az monitor data-collection rule performance-counter update

更新記錄性能計數器數據源。

副檔名 GA

az monitor data-collection rule performance-counter add

新增記錄性能計數器數據源。

az monitor data-collection rule performance-counter add --data-collection-rule-name
                                                        --name
                                                        --resource-group
                                                        [--counter-specifiers]
                                                        [--sampling-frequency]
                                                        [--streams]
                                                        [--transform-kql]

範例

新增記錄性能計數器數據源

az monitor data-collection rule performance-counter add --rule-name myCollectionRule --resource-group myResourceGroup --name team2ExtraCounters --streams Microsoft-Perf --counter-specifiers "\Process(_Total)\Thread Count" "\LogicalDisk(_Total)\FreeMegabytes" --sampling-frequency 30

必要參數

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

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

--name -n

數據源的易記名稱。 此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。

--resource-group -g

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

選擇性參數

--counter-specifiers

您想要收集之性能計數器的規範名稱清單。 使用通配符 \ 收集所有實例的計數器。 若要在 Windows 上取得性能計數器清單,請執行命令 『typeperf』。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--sampling-frequency --sampling-frequency-in-seconds

連續計數器度量之間的秒數(樣本)。

--streams

此數據源將傳送至的數據流清單。 數據流會指出將針對此數據使用哪些架構,而且通常會在Log Analytics中將數據傳送至哪個數據表。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--transform-kql

要轉換數據源的 KQL 查詢。

全域參數
--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 performance-counter delete

刪除記錄性能計數器數據源。

az monitor data-collection rule performance-counter delete --data-collection-rule-name
                                                           --name
                                                           --resource-group

範例

刪除記錄性能計數器數據源

az monitor data-collection rule performance-counter delete --rule-name myCollectionRule --resource-group myResourceGroup --name team2ExtraCounters

必要參數

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

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

--name -n

數據源的易記名稱。 此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。

--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 performance-counter list

列出記錄性能計數器數據源。

az monitor data-collection rule performance-counter list --data-collection-rule-name
                                                         --resource-group

範例

列出記錄性能計數器數據源

az monitor data-collection rule performance-counter list --rule-name myCollectionRule --resource-group myResourceGroup

必要參數

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

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

--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 performance-counter show

顯示記錄性能計數器數據源。

az monitor data-collection rule performance-counter show --data-collection-rule-name
                                                         --name
                                                         --resource-group

範例

顯示記錄性能計數器數據源

az monitor data-collection rule performance-counter show --rule-name myCollectionRule --resource-group myResourceGroup --name appTeamExtraCounters

必要參數

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

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

--name -n

數據源的易記名稱。 此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。

--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 performance-counter update

更新記錄性能計數器數據源。

az monitor data-collection rule performance-counter update --data-collection-rule-name
                                                           --name
                                                           --resource-group
                                                           [--add]
                                                           [--counter-specifiers]
                                                           [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                                           [--remove]
                                                           [--sampling-frequency]
                                                           [--set]
                                                           [--streams]
                                                           [--transform-kql]

範例

更新記錄性能計數器數據源

az monitor data-collection rule performance-counter update --rule-name myCollectionRule --resource-group myResourceGroup --name team2ExtraCounters

必要參數

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

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

--name -n

數據源的易記名稱。 此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。

--resource-group -g

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

選擇性參數

--add

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

--counter-specifiers

您想要收集之性能計數器的規範名稱清單。 使用通配符 \ 收集所有實例的計數器。 若要在 Windows 上取得性能計數器清單,請執行命令 『typeperf』。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--force-string

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

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

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

--sampling-frequency --sampling-frequency-in-seconds

連續計數器度量之間的秒數(樣本)。

--set

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

--streams

此數據源將傳送至的數據流清單。 數據流會指出將針對此數據使用哪些架構,而且通常會在Log Analytics中將數據傳送至哪個數據表。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--transform-kql

要轉換數據源的 KQL 查詢。

全域參數
--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 來取得完整偵錯記錄。