az monitor data-collection rule performance-counter

Note

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

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

命令

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

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

Extension GA
az monitor data-collection rule performance-counter delete

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

Extension GA
az monitor data-collection rule performance-counter list

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

Extension GA
az monitor data-collection rule performance-counter show

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

Extension GA
az monitor data-collection rule performance-counter update

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

Extension GA

az monitor data-collection rule performance-counter add

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

az monitor data-collection rule performance-counter add --data-collection-rule-name --rule-name
                                                        --name
                                                        --resource-group
                                                        [--acquire-policy-token]
                                                        [--change-reference]
                                                        [--counter-specifiers]
                                                        [--sampling-frequency --sampling-frequency-in-seconds]
                                                        [--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>來設定預設群組。

選擇性參數

下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。

--acquire-policy-token

自動取得 Azure 原則 令牌以進行此資源操作。

屬性 值
參數群組: Global Policy Arguments
--change-reference

相關變更的 ID 是為此資源操作所參考的。

屬性 值
參數群組: Global Policy Arguments
--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

提高日誌詳細程度以顯示所有調試日誌。

屬性 值
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性 值
預設值: False
--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性 值
預設值: False

az monitor data-collection rule performance-counter delete

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

az monitor data-collection rule performance-counter delete --data-collection-rule-name --rule-name
                                                           --name
                                                           --resource-group
                                                           [--acquire-policy-token]
                                                           [--change-reference]

範例

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

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>來設定預設群組。

選擇性參數

下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。

--acquire-policy-token

自動取得 Azure 原則 令牌以進行此資源操作。

屬性 值
參數群組: Global Policy Arguments
--change-reference

相關變更的 ID 是為此資源操作所參考的。

屬性 值
參數群組: Global Policy Arguments
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性 值
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性 值
預設值: False
--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性 值
預設值: False

az monitor data-collection rule performance-counter list

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

az monitor data-collection rule performance-counter list --data-collection-rule-name --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

提高日誌詳細程度以顯示所有調試日誌。

屬性 值
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性 值
預設值: False
--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性 值
預設值: False

az monitor data-collection rule performance-counter show

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

az monitor data-collection rule performance-counter show --data-collection-rule-name --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

提高日誌詳細程度以顯示所有調試日誌。

屬性 值
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性 值
預設值: False
--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性 值
預設值: False

az monitor data-collection rule performance-counter update

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

az monitor data-collection rule performance-counter update --data-collection-rule-name --rule-name
                                                           --name
                                                           --resource-group
                                                           [--acquire-policy-token]
                                                           [--add]
                                                           [--change-reference]
                                                           [--counter-specifiers]
                                                           [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                                           [--remove]
                                                           [--sampling-frequency --sampling-frequency-in-seconds]
                                                           [--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>來設定預設群組。

選擇性參數

下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。

--acquire-policy-token

自動取得 Azure 原則 令牌以進行此資源操作。

屬性 值
參數群組: Global Policy Arguments
--add

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

屬性 值
參數群組: Generic Update Arguments
--change-reference

相關變更的 ID 是為此資源操作所參考的。

屬性 值
參數群組: Global Policy Arguments
--counter-specifiers

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

--force-string

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

屬性 值
參數群組: Generic Update Arguments
接受的值: 0, 1, f, false, n, no, t, true, y, yes
--remove

從清單中移除屬性或專案。 範例: --remove property.list <indexToRemove> 或 --remove propertyToRemove。

屬性 值
參數群組: Generic Update Arguments
--sampling-frequency --sampling-frequency-in-seconds

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

--set

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

屬性 值
參數群組: Generic Update Arguments
--streams

此數據源將傳送至的數據流清單。 一個串流會顯示這些資料將使用的結構,通常也會顯示資料會傳送到Log Analytics的哪個資料表。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--transform-kql

要轉換數據源的 KQL 查詢。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性 值
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性 值
預設值: False
--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性 值
預設值: False