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

Scheduled Query Rules - Create Or Update

创建或更新计划的查询规则。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}?api-version=2021-08-01

URI 参数

Name In Required Type Description
resourceGroupName
path True
  • string

资源组的名称。 此名称不区分大小写。

ruleName
path True
  • string

规则的名称。

subscriptionId
path True
  • string

目标订阅的 ID。

api-version
query True
  • string

要用于此操作的 API 版本。

请求正文

Name Required Type Description
location True
  • string

资源所在的地理位置

properties.criteria True

定义计划查询规则条件的规则条件。

properties.enabled True
  • boolean

指示是否启用此计划的查询规则的标志。 值应为 true 或 false

properties.scopes True
  • string[]

此计划的查询规则的范围是资源 ID 的列表。

kind

指示计划的查询规则的类型。 默认值为 LogAlert。

properties.actions

触发警报时要调用的操作。

properties.autoMitigate
  • boolean

指示是否应自动解决警报的标志。 默认值为 true。 仅与 LogAlert 类型的规则相关。

properties.checkWorkspaceAlertsStorageConfigured
  • boolean

指示此计划查询规则是否应存储在客户的存储中的标志。 默认值为 false。 仅与 LogAlert 类型的规则相关。

properties.description
  • string

计划查询规则的说明。

properties.displayName
  • string

警报规则的显示名称

properties.evaluationFrequency
  • string

按 ISO 8601 持续时间格式计算计划查询规则的频率。 仅对 LogAlert 类型的规则相关且必需。

properties.muteActionsDuration
  • string

触发警报后,以 ISO 8601 持续时间格式 (将所选时间段的操作设为静音) 。 仅与 LogAlert 类型的规则相关。

properties.overrideQueryTimeRange
  • string

如果指定,则重写查询时间范围, (默认值为 WindowSize*NumberOfEvaluationPeriods) 。 仅与 LogAlert 类型的规则相关。

properties.severity

警报的严重性。 应为 [0-4] 之间的整数。 值为 0 最严重。 仅对 LogAlert 类型的规则相关且必需。

properties.skipQueryValidation
  • boolean

指示是否应验证提供的查询的标志。 默认值为 false。 仅与 LogAlert 类型的规则相关。

properties.targetResourceTypes
  • string[]

创建/更新警报的目标资源 () 的资源类型列表。 例如,如果范围是资源组,targetResourceTypes 是 Microsoft.Compute/virtualMachines,则会针对符合警报条件的资源组中的每个虚拟机触发不同的警报。 仅与 LogAlert 类型的规则相关

properties.windowSize
  • string

ISO 8601 持续时间格式的时间段 () ,将在) (箱大小执行警报查询。 仅对 LogAlert 类型的规则相关且必需。

tags
  • object

资源标记。

响应

Name Type Description
200 OK

成功请求以更新计划查询规则

201 Created

创建了计划查询规则

Other Status Codes

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation 模拟用户帐户

示例

Create or update a scheduled query rule for Single Resource
Create or update a scheduled query rule on Resource group(s)
Create or update a scheduled query rule on Subscription

Create or update a scheduled query rule for Single Resource

Sample Request

PUT https://management.azure.com/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourceGroups/QueryResourceGroupName/providers/Microsoft.Insights/scheduledQueryRules/perf?api-version=2021-08-01

{
  "location": "eastus",
  "properties": {
    "description": "Performance rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Perf | where ObjectName == \"Processor\"",
          "timeAggregation": "Average",
          "metricMeasureColumn": "% Processor Time",
          "resourceIdColumn": "resourceId",
          "dimensions": [
            {
              "name": "ComputerIp",
              "operator": "Exclude",
              "values": [
                "192.168.1.1"
              ]
            },
            {
              "name": "OSType",
              "operator": "Include",
              "values": [
                "*"
              ]
            }
          ],
          "operator": "GreaterThan",
          "threshold": 70,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}

Sample Response

{
  "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf",
  "name": "perf",
  "type": "microsoft.insights/scheduledqueryrules",
  "location": "eastus",
  "tags": {},
  "properties": {
    "description": "Performance rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Perf | where ObjectName == \"Processor\"",
          "timeAggregation": "Average",
          "metricMeasureColumn": "% Processor Time",
          "resourceIdColumn": "resourceId",
          "dimensions": [
            {
              "name": "ComputerIp",
              "operator": "Exclude",
              "values": [
                "192.168.1.1"
              ]
            },
            {
              "name": "OSType",
              "operator": "Include",
              "values": [
                "*"
              ]
            }
          ],
          "operator": "GreaterThan",
          "threshold": 70,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "isWorkspaceAlertsStorageConfigured": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}
{
  "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf",
  "name": "perf",
  "type": "microsoft.insights/scheduledqueryrules",
  "location": "eastus",
  "tags": {},
  "properties": {
    "description": "Performance rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Perf | where ObjectName == \"Processor\"",
          "timeAggregation": "Average",
          "metricMeasureColumn": "% Processor Time",
          "resourceIdColumn": "resourceId",
          "dimensions": [
            {
              "name": "ComputerIp",
              "operator": "Exclude",
              "values": [
                "192.168.1.1"
              ]
            },
            {
              "name": "OSType",
              "operator": "Include",
              "values": [
                "*"
              ]
            }
          ],
          "operator": "GreaterThan",
          "threshold": 70,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "isWorkspaceAlertsStorageConfigured": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}

Create or update a scheduled query rule on Resource group(s)

Sample Request

PUT https://management.azure.com/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourceGroups/QueryResourceGroupName/providers/Microsoft.Insights/scheduledQueryRules/heartbeat?api-version=2021-08-01

{
  "location": "eastus",
  "properties": {
    "description": "Health check rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1"
    ],
    "targetResourceTypes": [
      "Microsoft.Compute/virtualMachines"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Heartbeat",
          "timeAggregation": "Count",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 360,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}

Sample Response

{
  "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/heartbeat",
  "name": "heartbeat",
  "type": "microsoft.insights/scheduledqueryrules",
  "location": "eastus",
  "tags": {},
  "properties": {
    "description": "Health check rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1"
    ],
    "targetResourceTypes": [
      "Microsoft.Compute/virtualMachines"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Heartbeat",
          "timeAggregation": "Count",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 360,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "isWorkspaceAlertsStorageConfigured": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}
{
  "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/heartbeat",
  "name": "heartbeat",
  "type": "microsoft.insights/scheduledqueryrules",
  "location": "eastus",
  "tags": {},
  "properties": {
    "description": "Health check rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1"
    ],
    "targetResourceTypes": [
      "Microsoft.Compute/virtualMachines"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Heartbeat",
          "timeAggregation": "Count",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 360,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "isWorkspaceAlertsStorageConfigured": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}

Create or update a scheduled query rule on Subscription

Sample Request

PUT https://management.azure.com/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourceGroups/QueryResourceGroupName/providers/Microsoft.Insights/scheduledQueryRules/perf?api-version=2021-08-01

{
  "location": "eastus",
  "properties": {
    "description": "Performance rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"
    ],
    "targetResourceTypes": [
      "Microsoft.Compute/virtualMachines"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Perf | where ObjectName == \"Processor\"",
          "timeAggregation": "Average",
          "metricMeasureColumn": "% Processor Time",
          "resourceIdColumn": "resourceId",
          "dimensions": [
            {
              "name": "ComputerIp",
              "operator": "Exclude",
              "values": [
                "192.168.1.1"
              ]
            },
            {
              "name": "OSType",
              "operator": "Include",
              "values": [
                "*"
              ]
            }
          ],
          "operator": "GreaterThan",
          "threshold": 70,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}

Sample Response

{
  "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf",
  "name": "perf",
  "type": "microsoft.insights/scheduledqueryrules",
  "location": "eastus",
  "tags": {},
  "properties": {
    "description": "Performance rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"
    ],
    "targetResourceTypes": [
      "Microsoft.Compute/virtualMachines"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Perf | where ObjectName == \"Processor\"",
          "timeAggregation": "Average",
          "metricMeasureColumn": "% Processor Time",
          "resourceIdColumn": "resourceId",
          "dimensions": [
            {
              "name": "ComputerIp",
              "operator": "Exclude",
              "values": [
                "192.168.1.1"
              ]
            },
            {
              "name": "OSType",
              "operator": "Include",
              "values": [
                "*"
              ]
            }
          ],
          "operator": "GreaterThan",
          "threshold": 70,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "isWorkspaceAlertsStorageConfigured": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}
{
  "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf",
  "name": "perf",
  "type": "microsoft.insights/scheduledqueryrules",
  "location": "eastus",
  "tags": {},
  "properties": {
    "description": "Performance rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"
    ],
    "targetResourceTypes": [
      "Microsoft.Compute/virtualMachines"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Perf | where ObjectName == \"Processor\"",
          "timeAggregation": "Average",
          "metricMeasureColumn": "% Processor Time",
          "resourceIdColumn": "resourceId",
          "dimensions": [
            {
              "name": "ComputerIp",
              "operator": "Exclude",
              "values": [
                "192.168.1.1"
              ]
            },
            {
              "name": "OSType",
              "operator": "Include",
              "values": [
                "*"
              ]
            }
          ],
          "operator": "GreaterThan",
          "threshold": 70,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "isWorkspaceAlertsStorageConfigured": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}

定义

Actions

触发警报时要调用的操作。

AlertSeverity

警报的严重性。 应该是 [0-4] 之间的整数。 值为 0 的最严重值。 仅对 LogAlert 类型的规则相关且必需。

Condition

计划查询规则的条件。

conditionOperator

条件运算符。 仅对 LogAlert 类型的规则相关且必需。

createdByType

创建资源的标识的类型。

Dimension

维度拆分和筛选定义

dimensionOperator

维度值的运算符

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorContract

描述错误响应的格式。

ErrorResponse

错误响应

FailingPeriods

引发警报所需的所选回溯时间范围内所需的最小冲突数。 仅与 LogAlert 类型的规则相关。

Kind

指示计划的查询规则的类型。 默认值为 LogAlert。

ScheduledQueryRuleCriteria

定义计划查询规则条件的规则条件。

ScheduledQueryRuleResource

计划的查询规则资源。

systemData

与创建和上次修改资源相关的元数据。

timeAggregation

聚合类型。 仅对 LogAlert 类型的规则相关且必需。

Actions

触发警报时要调用的操作。

Name Type Description
actionGroups
  • string[]

触发警报时要调用的操作组资源 ID。

customProperties
  • object

警报有效负载的属性。

AlertSeverity

警报的严重性。 应该是 [0-4] 之间的整数。 值为 0 的最严重值。 仅对 LogAlert 类型的规则相关且必需。

Name Type Description
0
  • Integer
1
  • Integer
2
  • Integer
3
  • Integer
4
  • Integer

Condition

计划查询规则的条件。

Name Type Description
dimensions

维度条件列表

failingPeriods

在引发警报所需的所选回溯时间范围内所需的最小冲突数。 仅适用于类型 LogAlert 的规则。

metricMeasureColumn
  • string

包含指标度量值号的列。 仅适用于类型 LogAlert 的规则。

metricName
  • string

要发送的指标的名称。 仅对 LogToMetric 类型的规则相关且必需。

operator

条件运算符。 仅对 LogAlert 类型的规则相关且必需。

query
  • string

日志查询警报

resourceIdColumn
  • string

包含资源 ID 的列。列的内容必须是格式为资源 ID 的 URI。仅适用于类型 LogAlert 的规则。

threshold
  • number

激活警报的条件阈值。 仅对 LogAlert 类型的规则相关且必需。

timeAggregation

聚合类型。 仅对 LogAlert 类型的规则相关且必需。

conditionOperator

条件运算符。 仅对 LogAlert 类型的规则相关且必需。

Name Type Description
Equals
  • string
GreaterThan
  • string
GreaterThanOrEqual
  • string
LessThan
  • string
LessThanOrEqual
  • string

createdByType

创建资源的标识的类型。

Name Type Description
Application
  • string
Key
  • string
ManagedIdentity
  • string
User
  • string

Dimension

维度拆分和筛选定义

Name Type Description
name
  • string

维度的名称

operator

维度值的运算符

values
  • string[]

维度值列表

dimensionOperator

维度值的运算符

Name Type Description
Exclude
  • string
Include
  • string

ErrorAdditionalInfo

资源管理错误附加信息。

Name Type Description
info
  • object

其他信息。

type
  • string

其他信息类型。

ErrorContract

描述错误响应的格式。

Name Type Description
error

错误响应
错误详细信息。

ErrorResponse

错误响应

Name Type Description
additionalInfo

错误附加信息。

code
  • string

错误代码。

details

错误详细信息。

message
  • string

错误消息。

target
  • string

错误目标。

FailingPeriods

引发警报所需的所选回溯时间范围内所需的最小冲突数。 仅与 LogAlert 类型的规则相关。

Name Type Default Value Description
minFailingPeriodsToAlert
  • integer
1

触发警报的冲突数。 应小于或等于 numberOfEvaluationPeriods。 默认值为 1

numberOfEvaluationPeriods
  • integer
1

聚合回溯点数。 回溯时间窗口是根据聚合粒度计算的, (windowSize) 和所选聚合点数。 默认值为 1

Kind

指示计划的查询规则的类型。 默认值为 LogAlert。

Name Type Description
LogAlert
  • string
LogToMetric
  • string

ScheduledQueryRuleCriteria

定义计划查询规则条件的规则条件。

Name Type Description
allOf

要针对指定范围进行评估的条件列表

ScheduledQueryRuleResource

计划的查询规则资源。

Name Type Description
etag
  • string

不需要 etag 字段。 如果在响应正文中提供,则还必须根据正常的 etag 约定将其作为标头提供。 实体标记用于比较同一请求资源的两个或多个实体。 HTTP/1.1 在 etag (第 14.19 节) 中使用实体标记,If-Match (第 14.24 节) 、If-None-Match (第 14.26 节) ,If-Range (第 14.27 节) 标头字段。

id
  • string

资源的完全限定的资源 ID。 Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

kind

指示计划的查询规则的类型。 默认值为 LogAlert。

location
  • string

资源所在的地理位置

name
  • string

资源的名称

properties.actions

触发警报时要调用的操作。

properties.autoMitigate
  • boolean

指示是否应自动解决警报的标志。 默认值为 true。 仅适用于类型 LogAlert 的规则。

properties.checkWorkspaceAlertsStorageConfigured
  • boolean

指示此计划查询规则是否应存储在客户的存储中的标志。 默认值为 false。 仅适用于类型 LogAlert 的规则。

properties.createdWithApiVersion
  • string

创建此警报规则时使用的 API 版本

properties.criteria

定义计划查询规则条件的规则条件。

properties.description
  • string

计划查询规则的说明。

properties.displayName
  • string

警报规则的显示名称

properties.enabled
  • boolean

指示是否启用此计划查询规则的标志。 值应为 true 或 false

properties.evaluationFrequency
  • string

按 ISO 8601 持续时间格式计算计划的查询规则的计算频率。 仅对 LogAlert 类型的规则相关且必需。

properties.isLegacyLogAnalyticsRule
  • boolean

如此 如果警报规则是旧式 Log Analytic 规则

properties.isWorkspaceAlertsStorageConfigured
  • boolean

指示是否已将此计划查询规则配置为存储在客户的存储中的标志。 默认值为 false。

properties.muteActionsDuration
  • string

触发警报后,以 ISO 8601 持续时间格式 (将所选时间段的操作设为静音) 。 仅适用于类型 LogAlert 的规则。

properties.overrideQueryTimeRange
  • string

如果指定,则替代查询时间范围, (默认值为 WindowSize*NumberOfEvaluationPeriods) 。 仅适用于类型 LogAlert 的规则。

properties.scopes
  • string[]

此计划查询规则的范围是资源 ID 的列表。

properties.severity

警报的严重性。 应该是 [0-4] 之间的整数。 值为 0 的最严重值。 仅对 LogAlert 类型的规则相关且必需。

properties.skipQueryValidation
  • boolean

指示是否应验证提供的查询的标志。 默认值为 false。 仅适用于类型 LogAlert 的规则。

properties.targetResourceTypes
  • string[]

目标资源的资源类型列表 (创建/更新警报的) 。 例如,如果范围是资源组,targetResourceTypes 为 Microsoft.Compute/virtualMachines,则会针对符合警报条件的资源组中的每个虚拟机触发不同的警报。 仅适用于 LogAlert 类型的规则

properties.windowSize
  • string

ISO 8601 持续时间格式 (的时间段) ,警报查询将在) (箱大小执行。 仅对 LogAlert 类型的规则相关且必需。

systemData

ScheduledQueryRule 的 SystemData。

tags
  • object

资源标记。

type
  • string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft”。存储/storageAccounts”

systemData

与创建和上次修改资源相关的元数据。

Name Type Description
createdAt
  • string

资源创建时间戳 (UTC) 。

createdBy
  • string

创建资源的标识。

createdByType

创建资源的标识的类型。

lastModifiedAt
  • string

资源上次修改的时间戳 (UTC)

lastModifiedBy
  • string

上次修改资源的标识。

lastModifiedByType

上次修改资源的标识的类型。

timeAggregation

聚合类型。 仅对 LogAlert 类型的规则相关且必需。

Name Type Description
Average
  • string
Count
  • string
Maximum
  • string
Minimum
  • string
Total
  • string