New-AzScheduledQueryRuleConditionObject
Create an in-memory object for Condition.
Syntax
Default (Default)
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.
Parameter properties
Type: IDimension [ ]
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
-FailingPeriodMinFailingPeriodsToAlert
The number of violations to trigger an alert.
Should be smaller or equal to numberOfEvaluationPeriods.
Default value is 1.
Parameter properties
Type: Int64
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
-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.
Parameter properties
Type: Int64
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
-MetricMeasureColumn
The column containing the metric measure number.
Relevant only for rules of the kind LogAlert.
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
-MetricName
The name of the metric to be sent.
Relevant and required only for rules of the kind LogToMetric.
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
-Operator
The criteria operator.
Relevant and required only for rules of the kind LogAlert.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Query
Log query alert.
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
-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.
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
-Threshold
the criteria threshold value that activates the alert.
Relevant and required only for rules of the kind LogAlert.
Parameter properties
Type: Double
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
-TimeAggregation
Aggregation type.
Relevant and required only for rules of the kind LogAlert.
Parameter properties
Type: TimeAggregation
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
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 .
Outputs