你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

New-AzScheduledQueryRuleConditionObject

Create an in-memory object for Condition.

Syntax

New-AzScheduledQueryRuleConditionObject
   [-Dimension <IDimension[]>]
   [-FailingPeriodMinFailingPeriodsToAlert <Int64>]
   [-FailingPeriodNumberOfEvaluationPeriod <Int64>]
   [-MetricMeasureColumn <String>]
   [-MetricName <String>]
   [-Operator <ConditionOperator>]
   [-Query <String>]
   [-ResourceIdColumn <String>]
   [-Threshold <Double>]
   [-TimeAggregation <TimeAggregation>]
   [<CommonParameters>]

Description

Create an in-memory object for Condition.

Examples

Example 1: Create condition object

$dimension = New-AzScheduledQueryRuleDimensionObject -Name Computer -Operator Include -Value *
New-AzScheduledQueryRuleConditionObject -Dimension $dimension -Query "Perf | where ObjectName == `"Processor`" and CounterName == `"% Processor Time`" | summarize AggregatedValue = avg(CounterValue) by bin(TimeGenerated, 5m), Computer" -TimeAggregation "Average" -MetricMeasureColumn "AggregatedValue" -Operator "GreaterThan" -Threshold "70" -FailingPeriodNumberOfEvaluationPeriod 1 -FailingPeriodMinFailingPeriodsToAlert 1

Create condition object

Parameters

-Dimension

List of Dimensions conditions. To construct, see NOTES section for DIMENSION properties and create a hash table.

Type:IDimension[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FailingPeriodMinFailingPeriodsToAlert

The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1.

Type:Int64
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FailingPeriodNumberOfEvaluationPeriod

The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1.

Type:Int64
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MetricMeasureColumn

The column containing the metric measure number. Relevant only for rules of the kind LogAlert.

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

-MetricName

The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric.

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

-Operator

The criteria operator. Relevant and required only for rules of the kind LogAlert.

Type:ConditionOperator
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Query

Log query alert.

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

-ResourceIdColumn

The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert.

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

-Threshold

the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert.

Type:Double
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TimeAggregation

Aggregation type. Relevant and required only for rules of the kind LogAlert.

Type:TimeAggregation
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Condition