New-AzureRmMetricFilter

Creates a metric dimension filter that can be used to query metrics.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

New-AzureRmMetricFilter
   [-Dimension] <String>
   [-Operator] <String>
   [-Value] <String[]>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzureRmMetricFilter cmdlet creates a metric dimension filter that can be used to query metrics.

Examples

Example 1: Create a metric dimension filter

PS C:\>New-AzureRmMetricFilter -Dimension City -Operator eq -Value "Seattle","New York"

This command creates metric dimension filter of the format "City eq 'Seattle' or City eq 'New York'".

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Dimension

The name of the metric dimension.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Operator

Specifies the operator used to select the metric dimension.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Value

Specifies the array of metric dimension values.

Type:String[]
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

String[]

Outputs

String