az monitor data-collection rule syslog

注意

此參考是 Azure CLI 的 monitor-control-service 擴充功能的一部分(2.55.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 --facility-names {*, auth, authpriv, cron, daemon, kern, local0, local1, local2, local3, local4, local5, local6, local7, lpr, mail, mark, news, syslog, user, uucp}
                                           --name
                                           --resource-group
                                           --rule-name
                                           --streams {Microsoft-Syslog}
                                           [--log-levels {*, Alert, Critical, Debug, Emergency, Error, Info, Notice, Warning}]

範例

新增 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"

必要參數

--facility-names

設施名稱的清單。

接受的值: *, auth, authpriv, cron, daemon, kern, local0, local1, local2, local3, local4, local5, local6, local7, lpr, mail, mark, news, syslog, user, uucp
--name -n

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

--resource-group -g

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

--rule-name

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

--streams

此數據源將傳送至的數據流清單。 數據流會指出將針對此數據使用哪些架構,而且通常會在Log Analytics中將數據傳送至哪個數據表。

接受的值: Microsoft-Syslog

選擇性參數

--log-levels

要收集的記錄層級。

接受的值: *, Alert, Critical, Debug, Emergency, Error, Info, Notice, Warning
全域參數
--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 --name
                                              --resource-group
                                              --rule-name

範例

刪除 Syslog 資料源

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

必要參數

--name -n

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

--resource-group -g

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

--rule-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 --resource-group
                                            --rule-name

範例

列出 Syslog 數據源

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

必要參數

--resource-group -g

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

--rule-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 --name
                                            --resource-group
                                            --rule-name

範例

顯示 Syslog 數據源

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

必要參數

--name -n

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

--resource-group -g

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

--rule-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 --name
                                              --resource-group
                                              --rule-name
                                              [--facility-names {*, auth, authpriv, cron, daemon, kern, local0, local1, local2, local3, local4, local5, local6, local7, lpr, mail, mark, news, syslog, user, uucp}]
                                              [--log-levels {*, Alert, Critical, Debug, Emergency, Error, Info, Notice, Warning}]
                                              [--streams {Microsoft-Syslog}]

範例

更新 Syslog 數據源

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

必要參數

--name -n

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

--resource-group -g

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

--rule-name

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

選擇性參數

--facility-names

設施名稱的清單。

接受的值: *, auth, authpriv, cron, daemon, kern, local0, local1, local2, local3, local4, local5, local6, local7, lpr, mail, mark, news, syslog, user, uucp
--log-levels

要收集的記錄層級。

接受的值: *, Alert, Critical, Debug, Emergency, Error, Info, Notice, Warning
--streams

此數據源將傳送至的數據流清單。 數據流會指出將針對此數據使用哪些架構,而且通常會在Log Analytics中將數據傳送至哪個數據表。

接受的值: Microsoft-Syslog
全域參數
--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 來取得完整偵錯記錄。