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 パラメーター

名前 / 必須 説明
resourceGroupName
path True

string

リソース グループの名前。 名前の大文字と小文字は区別されます。

ruleName
path True

string

ルールの名前です。

subscriptionId
path True

string

ターゲット サブスクリプションの ID。

api-version
query True

string

この操作に使用する API バージョン。

要求本文

名前 必須 説明
location True

string

リソースが保存されている地理的な場所

properties.criteria True

ScheduledQueryRuleCriteria

スケジュールされたクエリ ルールの条件を定義するルールの条件。

properties.enabled True

boolean

このスケジュールされたクエリ ルールが有効になっているかどうかを示すフラグ。 値は true または false にする必要があります

properties.scopes True

string[]

このスケジュールされたクエリ ルールのスコープが設定されているリソース ID の一覧。

kind

Kind

スケジュールされたクエリ ルールの種類を示します。 既定値は LogAlert です。

properties.actions

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

AlertSeverity

アラートの重大度。 [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

リソース タグ。

応答

名前 説明
200 OK

ScheduledQueryRuleResource

スケジュールされたクエリ ルールを更新する要求が成功しました

201 Created

ScheduledQueryRuleResource

スケジュールされたクエリ ルールを作成しました

Other Status Codes

ErrorContract

操作に失敗した理由を説明するエラー応答。

セキュリティ

azure_auth

Azure Active Directory OAuth2 フロー

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

Scopes

名前 説明
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

criteria 演算子。 LogAlert の種類のルールにのみ関連し、必須です。

createdByType

リソースを作成した ID の種類。

Dimension

ディメンションの分割とフィルター処理の定義

dimensionOperator

ディメンション値の演算子

ErrorAdditionalInfo

リソース管理エラーの追加情報。

ErrorContract

エラー応答の形式について説明します。

ErrorResponse

エラー応答

FailingPeriods

アラートの発生に必要な、選択したルックバック時間枠内で必要な違反の最小数。 LogAlert の種類のルールにのみ関連します。

Kind

スケジュールされたクエリ ルールの種類を示します。 既定値は LogAlert です。

ScheduledQueryRuleCriteria

スケジュールされたクエリ ルールの条件を定義するルールの条件。

ScheduledQueryRuleResource

スケジュールされたクエリ ルール リソース。

systemData

リソースの作成と最後の変更に関連するメタデータ。

timeAggregation

集計の種類。 LogAlert の種類のルールにのみ関連し、必須です。

Actions

アラートが発生したときに呼び出すアクション。

名前 説明
actionGroups

string[]

アラートが発生したときに呼び出すアクション グループ リソース ID。

customProperties

object

アラート ペイロードのプロパティ。

AlertSeverity

アラートの重大度。 [0 から 4] の間の整数である必要があります。 値 0 は最も厳しいです。 LogAlert の種類のルールにのみ関連し、必須です。

名前 説明
0

Integer

1

Integer

2

Integer

3

Integer

4

Integer

Condition

スケジュールされたクエリ ルールの条件。

名前 説明
dimensions

Dimension[]

ディメンション条件の一覧

failingPeriods

FailingPeriods

アラートを発生させるために必要な、選択したルックバック時間枠内に必要な違反の最小数。 LogAlert の種類のルールにのみ関連します。

metricMeasureColumn

string

メトリックメジャー番号を含む列。 LogAlert の種類のルールにのみ関連します。

metricName

string

送信するメトリックの名前。 LogToMetric の種類のルールにのみ関連し、必須です。

operator

conditionOperator

criteria 演算子。 LogAlert の種類のルールにのみ関連し、必須です。

query

string

ログ クエリ アラート

resourceIdColumn

string

リソース ID を含む列。列の内容は、リソース ID として書式設定された URI である必要があります。LogAlert の種類のルールにのみ関連します。

threshold

number

アラートをアクティブにする条件しきい値。 LogAlert の種類のルールにのみ関連し、必須です。

timeAggregation

timeAggregation

集計の種類。 LogAlert の種類のルールにのみ関連し、必須です。

conditionOperator

criteria 演算子。 LogAlert の種類のルールにのみ関連し、必須です。

名前 説明
Equals

string

GreaterThan

string

GreaterThanOrEqual

string

LessThan

string

LessThanOrEqual

string

createdByType

リソースを作成した ID の種類。

名前 説明
Application

string

Key

string

ManagedIdentity

string

User

string

Dimension

ディメンションの分割とフィルター処理の定義

名前 説明
name

string

ディメンションの名前

operator

dimensionOperator

ディメンション値の演算子

values

string[]

ディメンション値の一覧

dimensionOperator

ディメンション値の演算子

名前 説明
Exclude

string

Include

string

ErrorAdditionalInfo

リソース管理エラーの追加情報。

名前 説明
info

object

追加情報。

type

string

追加情報の種類。

ErrorContract

エラー応答の形式について説明します。

名前 説明
error

ErrorResponse

エラー応答
エラーの詳細です。

ErrorResponse

エラー応答

名前 説明
additionalInfo

ErrorAdditionalInfo[]

エラーの追加情報。

code

string

エラー コード。

details

ErrorResponse[]

エラーの詳細です。

message

string

エラー メッセージ。

target

string

エラーのターゲット。

FailingPeriods

アラートの発生に必要な、選択したルックバック時間枠内で必要な違反の最小数。 LogAlert の種類のルールにのみ関連します。

名前 既定値 説明
minFailingPeriodsToAlert

integer

1

アラートをトリガーする違反の数。 numberOfEvaluationPeriods 以下にする必要があります。 既定値は 1。

numberOfEvaluationPeriods

integer

1

集計されたルックバック ポイントの数。 ルックバック タイム ウィンドウは、集計粒度 (windowSize) と、選択した集計ポイント数に基づいて計算されます。 既定値は 1。

Kind

スケジュールされたクエリ ルールの種類を示します。 既定値は LogAlert です。

名前 説明
LogAlert

string

LogToMetric

string

ScheduledQueryRuleCriteria

スケジュールされたクエリ ルールの条件を定義するルールの条件。

名前 説明
allOf

Condition[]

指定したスコープに対して評価する条件の一覧

ScheduledQueryRuleResource

スケジュールされたクエリ ルール リソース。

名前 説明
etag

string

etag フィールドは必要 ありません 。 応答本文で指定する場合は、通常の etag 規則に従ってヘッダーとしても指定する必要があります。 エンティティ タグは、同じ要求されたリソースから 2 つ以上のエンティティを比較するために使用されます。 HTTP/1.1 では、etag (セクション 14.19)、If-Match (セクション 14.24)、If-None-Match (セクション 14.26)、および If-Range (セクション 14.27) ヘッダー フィールドでエンティティ タグを使用します。

id

string

リソースの完全修飾リソース ID。 例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

kind

Kind

スケジュールされたクエリ ルールの種類を示します。 既定値は LogAlert です。

location

string

リソースが保存されている地理的な場所

name

string

リソースの名前

properties.actions

Actions

アラートが発生したときに呼び出すアクション。

properties.autoMitigate

boolean

アラートを自動的に解決するかどうかを示すフラグ。 既定値は true です。 LogAlert の種類のルールにのみ関連します。

properties.checkWorkspaceAlertsStorageConfigured

boolean

このスケジュールされたクエリ ルールを顧客のストレージに格納するかどうかを示すフラグ。 既定値は false です。 LogAlert の種類のルールにのみ関連します。

properties.createdWithApiVersion

string

このアラート ルールの作成時に使用される API バージョン

properties.criteria

ScheduledQueryRuleCriteria

スケジュールされたクエリ ルールの条件を定義するルールの条件。

properties.description

string

スケジュールされたクエリ ルールの説明。

properties.displayName

string

アラート ルールの表示名

properties.enabled

boolean

このスケジュールされたクエリ ルールが有効になっているかどうかを示すフラグ。 値は true または false にする必要があります

properties.evaluationFrequency

string

スケジュールされたクエリ ルールが評価される頻度は、ISO 8601 期間形式で表されます。 LogAlert の種類のルールにのみ関連し、必須です。

properties.isLegacyLogAnalyticsRule

boolean

アラート ルールが従来の Log Analytic ルールの場合は True

properties.isWorkspaceAlertsStorageConfigured

boolean

このスケジュールされたクエリ ルールが顧客のストレージに格納されるように構成されているかどうかを示すフラグ。 既定値は false です。

properties.muteActionsDuration

string

アラートが発生した後、選択した期間 (ISO 8601 期間形式) のアクションをミュートします。 LogAlert の種類のルールにのみ関連します。

properties.overrideQueryTimeRange

string

指定した場合は、クエリの時間範囲をオーバーライドします (既定値は WindowSize*NumberOfEvaluationPeriods)。 LogAlert の種類のルールにのみ関連します。

properties.scopes

string[]

このスケジュールされたクエリ ルールのスコープが設定されているリソース ID の一覧。

properties.severity

AlertSeverity

アラートの重大度。 [0 から 4] の間の整数である必要があります。 値 0 は最も厳しいです。 LogAlert の種類のルールにのみ関連し、必須です。

properties.skipQueryValidation

boolean

指定されたクエリを検証する必要があるかどうかを示すフラグ。 既定値は false です。 LogAlert の種類のルールにのみ関連します。

properties.targetResourceTypes

string[]

アラートが作成または更新されるターゲット リソースのリソースの種類の一覧。 たとえば、スコープがリソース グループで targetResourceTypes が Microsoft.Compute/virtualMachines の場合、アラート条件を満たすリソース グループ内の仮想マシンごとに異なるアラートが発生します。 LogAlert の種類のルールにのみ関連します

properties.windowSize

string

アラート クエリが実行される期間 (ISO 8601 期間形式) (ビン サイズ)。 LogAlert の種類のルールにのみ関連し、必須です。

systemData

systemData

ScheduledQueryRule の SystemData。

tags

object

リソース タグ。

type

string

リソースの型。 例: "Microsoft.Compute/virtualMachines" または "Microsoft.Storage/storageAccounts"

systemData

リソースの作成と最後の変更に関連するメタデータ。

名前 説明
createdAt

string

リソース作成のタイムスタンプ (UTC)。

createdBy

string

リソースを作成した ID。

createdByType

createdByType

リソースを作成した ID の種類。

lastModifiedAt

string

リソースの最終変更のタイムスタンプ (UTC)

lastModifiedBy

string

リソースを最後に変更した ID。

lastModifiedByType

createdByType

リソースを最後に変更した ID の種類。

timeAggregation

集計の種類。 LogAlert の種類のルールにのみ関連し、必須です。

名前 説明
Average

string

Count

string

Maximum

string

Minimum

string

Total

string