Edit

Share via


Update-AzDataCollectionRule

Update a data collection rule.

Syntax

UpdateExpanded (Default)

Update-AzDataCollectionRule
    -Name <String>
    -ResourceGroupName <String>
    [-SubscriptionId <String>]
    [-DataCollectionEndpointId <String>]
    [-DataFlow <IDataFlow[]>]
    [-DataSourceDataImportEventHubConsumerGroup <String>]
    [-DataSourceDataImportEventHubName <String>]
    [-DataSourceDataImportEventHubStream <String>]
    [-DataSourceExtension <IExtensionDataSource[]>]
    [-DataSourceIisLog <IIisLogsDataSource[]>]
    [-DataSourceLogFile <ILogFilesDataSource[]>]
    [-DataSourcePerformanceCounter <IPerfCounterDataSource[]>]
    [-DataSourcePlatformTelemetry <IPlatformTelemetryDataSource[]>]
    [-DataSourcePrometheusForwarder <IPrometheusForwarderDataSource[]>]
    [-DataSourceSyslog <ISyslogDataSource[]>]
    [-DataSourceWindowsEventLog <IWindowsEventLogDataSource[]>]
    [-DataSourceWindowsFirewallLog <IWindowsFirewallLogsDataSource[]>]
    [-Description <String>]
    [-DestinationAzureMonitorMetricName <String>]
    [-DestinationEventHub <IEventHubDestination[]>]
    [-DestinationEventHubsDirect <IEventHubDirectDestination[]>]
    [-DestinationLogAnalytic <ILogAnalyticsDestination[]>]
    [-DestinationMonitoringAccount <IMonitoringAccountDestination[]>]
    [-DestinationStorageAccount <IStorageBlobDestination[]>]
    [-DestinationStorageBlobsDirect <IStorageBlobDestination[]>]
    [-DestinationStorageTablesDirect <IStorageTableDestination[]>]
    [-EnableSystemAssignedIdentity <Boolean>]
    [-Kind <String>]
    [-StreamDeclaration <Hashtable>]
    [-Tag <Hashtable>]
    [-UserAssignedIdentity <String[]>]
    [-DefaultProfile <PSObject>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

UpdateViaIdentityExpanded

Update-AzDataCollectionRule
    -InputObject <IDataCollectionRuleIdentity>
    [-DataCollectionEndpointId <String>]
    [-DataFlow <IDataFlow[]>]
    [-DataSourceDataImportEventHubConsumerGroup <String>]
    [-DataSourceDataImportEventHubName <String>]
    [-DataSourceDataImportEventHubStream <String>]
    [-DataSourceExtension <IExtensionDataSource[]>]
    [-DataSourceIisLog <IIisLogsDataSource[]>]
    [-DataSourceLogFile <ILogFilesDataSource[]>]
    [-DataSourcePerformanceCounter <IPerfCounterDataSource[]>]
    [-DataSourcePlatformTelemetry <IPlatformTelemetryDataSource[]>]
    [-DataSourcePrometheusForwarder <IPrometheusForwarderDataSource[]>]
    [-DataSourceSyslog <ISyslogDataSource[]>]
    [-DataSourceWindowsEventLog <IWindowsEventLogDataSource[]>]
    [-DataSourceWindowsFirewallLog <IWindowsFirewallLogsDataSource[]>]
    [-Description <String>]
    [-DestinationAzureMonitorMetricName <String>]
    [-DestinationEventHub <IEventHubDestination[]>]
    [-DestinationEventHubsDirect <IEventHubDirectDestination[]>]
    [-DestinationLogAnalytic <ILogAnalyticsDestination[]>]
    [-DestinationMonitoringAccount <IMonitoringAccountDestination[]>]
    [-DestinationStorageAccount <IStorageBlobDestination[]>]
    [-DestinationStorageBlobsDirect <IStorageBlobDestination[]>]
    [-DestinationStorageTablesDirect <IStorageTableDestination[]>]
    [-EnableSystemAssignedIdentity <Boolean>]
    [-Kind <String>]
    [-StreamDeclaration <Hashtable>]
    [-Tag <Hashtable>]
    [-UserAssignedIdentity <String[]>]
    [-DefaultProfile <PSObject>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Update a data collection rule.

Examples

Example 1: Update tag for data collection rule

$syslog = New-AzSyslogDataSourceObject -FacilityName syslog -LogLevel Alert,Critical,Emergency -Name syslogBase -Stream Microsoft-Syslog
Update-AzDataCollectionRule -Name myCollectionRule1 -ResourceGroupName Monitor-ActionGroup -DataSourceSyslog $syslog
DataCollectionEndpointId                  :
DataFlow                                  : {{
                                              "streams": [ "Microsoft-InsightsMetrics" ],
                                              "destinations": [ "azureMonitorMetrics-default" ]
                                            }}
DataSourceDataImportEventHubConsumerGroup :
DataSourceDataImportEventHubName          :
DataSourceDataImportEventHubStream        :
DataSourceExtension                       :
DataSourceIisLog                          :
DataSourceLogFile                         :
DataSourcePerformanceCounter              : {{
                                              "streams": [ "Microsoft-Perf" ],
                                              "samplingFrequencyInSeconds": 15,
                                              "counterSpecifiers": [ "\\\\Processor(_Total)\\\\% Processor Time", "\\\\Memory\\\\Committed Bytes",
                                            "\\\\LogicalDisk(_Total)\\\\Free Megabytes", "\\\\PhysicalDisk(_Total)\\\\Avg. Disk Queue Length" ],
                                              "name": "cloudTeamCoreCounters"
                                            }, {
                                              "streams": [ "Microsoft-Perf" ],
                                              "samplingFrequencyInSeconds": 30,
                                              "counterSpecifiers": [ "\\\\Process(_Total)\\\\Thread Count" ],
                                              "name": "appTeamExtraCounters"
                                            }}
DataSourcePlatformTelemetry               :
DataSourcePrometheusForwarder             :
DataSourceSyslog                          : {{
                                              "streams": [ "Microsoft-Syslog" ],
                                              "facilityNames": [ "syslog" ],
                                              "logLevels": [ "Alert", "Critical", "Emergency" ],
                                              "name": "syslogBase"
                                            }}
DataSourceWindowsEventLog                 : {{
                                              "streams": [ "Microsoft-WindowsEvent" ],
                                              "xPathQueries": [ "System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level = 1 or Level = 2
                                            or Level = 3)]]" ],
                                              "name": "appTeam1AppEvents"
                                            }}
DataSourceWindowsFirewallLog              :
Description                               :
DestinationAzureMonitorMetricName         : azureMonitorMetrics-default
DestinationEventHub                       :
DestinationEventHubsDirect                :
DestinationLogAnalytic                    :
DestinationMonitoringAccount              :
DestinationStorageAccount                 :
DestinationStorageBlobsDirect             :
DestinationStorageTablesDirect            :
Etag                                      : "9200a3d3-0000-0100-0000-654c72ae0000"
Id                                        : /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/Monitor-ActionGroup/providers/Microsoft.Insights/dataColle
                                            ctionRules/myCollectionRule1
IdentityPrincipalId                       :
IdentityTenantId                          :
IdentityType                              :
IdentityUserAssignedIdentity              : {
                                            }
ImmutableId                               : dcr-e30a8188813f426d962ef7053a3d1be4
Kind                                      :
Location                                  : eastus
MetadataProvisionedBy                     :
MetadataProvisionedByResourceId           :
Name                                      : myCollectionRule1
ProvisioningState                         : Succeeded
ResourceGroupName                         : Monitor-ActionGroup
StreamDeclaration                         : {
                                            }
SystemDataCreatedAt                       : 11/9/2023 5:04:01 AM
SystemDataCreatedBy                       : v-jiaji@microsoft.com
SystemDataCreatedByType                   : User
SystemDataLastModifiedAt                  : 11/9/2023 5:48:29 AM
SystemDataLastModifiedBy                  : v-jiaji@microsoft.com
SystemDataLastModifiedByType              : User
Tag                                       : {
                                            }
Type                                      : Microsoft.Insights/dataCollectionRules

This command updates data collection rule.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataCollectionEndpointId

The resource ID of the data collection endpoint that this rule can be used with.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataFlow

The specification of data flows.

Parameter properties

Type:

IDataFlow[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataSourceDataImportEventHubConsumerGroup

Event Hub consumer group name

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataSourceDataImportEventHubName

A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the data collection rule.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataSourceDataImportEventHubStream

The stream to collect from EventHub

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataSourceExtension

The list of Azure VM extension data source configurations.

Parameter properties

Type:

IExtensionDataSource[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataSourceIisLog

The list of IIS logs source configurations.

Parameter properties

Type:

IIisLogsDataSource[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataSourceLogFile

The list of Log files source configurations.

Parameter properties

Type:

ILogFilesDataSource[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataSourcePerformanceCounter

The list of performance counter data source configurations.

Parameter properties

Type:

IPerfCounterDataSource[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataSourcePlatformTelemetry

The list of platform telemetry configurations

Parameter properties

Type:

IPlatformTelemetryDataSource[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataSourcePrometheusForwarder

The list of Prometheus forwarder data source configurations.

Parameter properties

Type:

IPrometheusForwarderDataSource[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataSourceSyslog

The list of Syslog data source configurations.

Parameter properties

Type:

ISyslogDataSource[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataSourceWindowsEventLog

The list of Windows Event Log data source configurations.

Parameter properties

Type:

IWindowsEventLogDataSource[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DataSourceWindowsFirewallLog

The list of Windows Firewall logs source configurations.

Parameter properties

Type:

IWindowsFirewallLogsDataSource[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Parameter properties

Type:PSObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzureRMContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Description

Description of the data collection rule.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationAzureMonitorMetricName

A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the data collection rule.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationEventHub

List of Event Hubs destinations.

Parameter properties

Type:

IEventHubDestination[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationEventHubsDirect

List of Event Hubs Direct destinations.

Parameter properties

Type:

IEventHubDirectDestination[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationLogAnalytic

List of Log Analytics destinations.

Parameter properties

Type:

ILogAnalyticsDestination[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationMonitoringAccount

List of monitoring account destinations.

Parameter properties

Type:

IMonitoringAccountDestination[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationStorageAccount

List of storage accounts destinations.

Parameter properties

Type:

IStorageBlobDestination[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationStorageBlobsDirect

List of Storage Blob Direct destinations. To be used only for sending data directly to store from the agent.

Parameter properties

Type:

IStorageBlobDestination[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationStorageTablesDirect

List of Storage Table Direct destinations.

Parameter properties

Type:

IStorageTableDestination[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableSystemAssignedIdentity

Determines whether to enable a system-assigned identity for the resource.

Parameter properties

Type:

Nullable<T>[Boolean]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Identity Parameter

Parameter properties

Type:IDataCollectionRuleIdentity
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

UpdateViaIdentityExpanded
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Kind

The kind of the resource.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

The name of the data collection rule. The name is case insensitive.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DataCollectionRuleName, RuleName

Parameter sets

UpdateExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

The name of the resource group. The name is case insensitive.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

UpdateExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StreamDeclaration

Declaration of custom streams used in this rule.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SubscriptionId

The ID of the target subscription.

Parameter properties

Type:String
Default value:(Get-AzContext).Subscription.Id
Supports wildcards:False
DontShow:False

Parameter sets

UpdateExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Tag

Resource tags.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-UserAssignedIdentity

The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

IDataCollectionRuleIdentity

Outputs

IDataCollectionRuleResource