共用方式為


az monitor data-collection rule syslog

備註

此參考是 Azure CLI monitor-control-service 延伸模組的一部分(2.61.0 版或更高版本)。 當您第一次執行 az monitor data-collection rule syslog 命令時,擴充功能會自動安裝。 深入瞭解擴充功能

管理 Syslog 數據源。

命令

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

新增 Syslog 數據源。

擴充套件 GA
az monitor data-collection rule syslog delete

刪除 Syslog 資料源。

擴充套件 GA
az monitor data-collection rule syslog list

列出 Syslog 數據源。

擴充套件 GA
az monitor data-collection rule syslog show

顯示 Syslog 數據源。

擴充套件 GA
az monitor data-collection rule syslog update

更新 Syslog 數據源。

擴充套件 GA

az monitor data-collection rule syslog add

新增 Syslog 數據源。

az monitor data-collection rule syslog add --data-collection-rule-name
                                           --name
                                           --resource-group
                                           [--facility-names]
                                           [--log-levels]
                                           [--streams]
                                           [--transform-kql]

範例

新增 Syslog 數據源

az monitor data-collection rule syslog add --rule-name myCollectionRule --resource-group myResourceGroup --name syslogBase --facility-names syslog --log-levels Alert Critical --streams Microsoft-Syslog

必要參數

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

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

--name -n

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

--resource-group -g

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

選擇性參數

--facility-names

設施名稱的清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--log-levels

要收集的記錄層級。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--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 syslog delete

刪除 Syslog 資料源。

az monitor data-collection rule syslog delete --data-collection-rule-name
                                              --name
                                              --resource-group

範例

刪除 Syslog 資料源

az monitor data-collection rule syslog delete --rule-name myCollectionRule --resource-group myResourceGroup --name syslogBase

必要參數

--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 syslog list

列出 Syslog 數據源。

az monitor data-collection rule syslog list --data-collection-rule-name
                                            --resource-group

範例

列出 Syslog 數據源

az monitor data-collection rule syslog 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 syslog show

顯示 Syslog 數據源。

az monitor data-collection rule syslog show --data-collection-rule-name
                                            --name
                                            --resource-group

範例

顯示 Syslog 數據源

az monitor data-collection rule syslog show --rule-name myCollectionRule --resource-group myResourceGroup --name syslogBase

必要參數

--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 syslog update

更新 Syslog 數據源。

az monitor data-collection rule syslog update --data-collection-rule-name
                                              --name
                                              --resource-group
                                              [--add]
                                              [--facility-names]
                                              [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                              [--log-levels]
                                              [--remove]
                                              [--set]
                                              [--streams]
                                              [--transform-kql]

範例

更新 Syslog 數據源

az monitor data-collection rule syslog update --rule-name myCollectionRule --resource-group myResourceGroup --name syslogBase --facility-names syslog --log-levels Emergency Critical

必要參數

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

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

--name -n

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

--resource-group -g

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

選擇性參數

--add

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

--facility-names

設施名稱的清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--force-string

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

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

要收集的記錄層級。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--remove

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

--set

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

--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。