az monitor data-collection rule
Note
This reference is part of the monitor-control-service extension for the Azure CLI (version 2.15.0 or higher). The extension will automatically install the first time you run an az monitor data-collection rule command. Learn more about extensions.
Manage data collection rule for monitor control service.
Commands
az monitor data-collection rule create
Create a data collection rule.
az monitor data-collection rule create --name
--resource-group
--rule-file
[--description]
[--location]
[--tags]
Examples
Create data collection rule
az monitor data-collection rule create --resource-group "myResourceGroup" --location "eastus" --name "myCollectionRule" --rule-file "C:\samples\dcrEx1.json"
Required Parameters
The name of the data collection rule. The name is case insensitive.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
The json file for rule parameters.
Optional Parameters
Description of the data collection rule.
Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
az monitor data-collection rule delete
Deletes a data collection rule.
az monitor data-collection rule delete --name
--resource-group
[--yes]
Examples
Delete data collection rule
az monitor data-collection rule delete --name "myCollectionRule" --resource-group "myResourceGroup"
Required Parameters
The name of the data collection rule. The name is case insensitive.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Optional Parameters
Do not prompt for confirmation.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
az monitor data-collection rule list
List all data collection rules in the specified resource group. And Lists all data collection rules in the specified subscription.
az monitor data-collection rule list [--resource-group]
Examples
List data collection rules by resource group
az monitor data-collection rule list --resource-group "myResourceGroup"
List data collection rules by subscription
az monitor data-collection rule list
Optional Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
az monitor data-collection rule show
Return the specified data collection rule.
az monitor data-collection rule show --name
--resource-group
Examples
Get data collection rule
az monitor data-collection rule show --name "myCollectionRule" --resource-group "myResourceGroup"
Required Parameters
The name of the data collection rule. The name is case insensitive.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
az monitor data-collection rule update
Update a data collection rule.
az monitor data-collection rule update --name
--resource-group
[--data-flows]
[--description]
[--extensions]
[--log-analytics]
[--monitor-metrics]
[--performance-counters]
[--syslog]
[--tags]
[--windows-event-logs]
Examples
Update data collection rule
az monitor data-collection rule update --resource-group "myResourceGroup" --name "myCollectionRule" --data-flows destinations="centralWorkspace" streams="Microsoft-Perf" streams="Microsoft-Syslog" streams="Microsoft-WindowsEvent" --log-analytics name="centralWorkspace" resource-id="/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace" --performance-counters name="appTeamExtraCounters" counter-specifiers="\\Process(_Total)\\Thread Count" sampling-frequency=30 streams="Microsoft-Perf" --syslog name="cronSyslog" facility-names="cron" log-levels="Debug" log-levels="Critical" log-levels="Emergency" streams="Microsoft-Syslog" --windows-event-logs name="cloudSecurityTeamEvents" streams="Microsoft-WindowsEvent" x-path-queries="Security!"
Required Parameters
The name of the data collection rule. The name is case insensitive.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Optional Parameters
The specification of data flows.
Description of the data collection rule.
The list of Azure VM extension data source configurations. Expected value: json-string/@json-file.
List of Log Analytics destinations.
Azure Monitor Metrics destination.
The list of performance counter data source configurations.
The list of Syslog data source configurations.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
The list of Windows Event Log data source configurations.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
الملاحظات
إرسال الملاحظات وعرضها المتعلقة بـ