Scheduled Query Rules - List By Resource Group

リソース グループ内のログ検索ルールを一覧表示します。

GET https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules?api-version=2018-04-16
GET https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules?api-version=2018-04-16&$filter={$filter}

URI パラメーター

名前 / 必須 説明
resourceGroupName
path True

string

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

subscriptionId
path True

string

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

api-version
query True

string

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

$filter
query

string

操作に適用するフィルター。 詳細については、以下を参照してください。 https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx

応答

名前 説明
200 OK

LogSearchRuleResourceCollection

アラート ルールの一覧に対する要求が成功しました

Other Status Codes

ErrorContract

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

セキュリティ

azure_auth

Azure Active Directory OAuth2 フロー

型: oauth2
フロー: implicit
Authorization URL (承認 URL): https://login.microsoftonline.com/common/oauth2/authorize

スコープ

名前 説明
user_impersonation ユーザー アカウントの借用

List rules

要求のサンプル

GET https://management.azure.com/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/Microsoft.Insights/scheduledQueryRules?api-version=2018-04-16

応答のサンプル

{
  "value": [
    {
      "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo",
      "name": "logalertfoo",
      "type": "Microsoft.Insights/scheduledQueryRules",
      "location": "West US",
      "tags": {},
      "properties": {
        "description": "log alert description",
        "enabled": "false",
        "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z",
        "provisioningState": "Succeeded",
        "source": {
          "query": "requests",
          "queryType": "ResultCount",
          "dataSourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI"
        },
        "schedule": {
          "frequencyInMinutes": 15,
          "timeWindowInMinutes": 15
        },
        "action": {
          "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction",
          "severity": "1",
          "trigger": {
            "thresholdOperator": "GreaterThan",
            "threshold": 2,
            "metricTrigger": {
              "thresholdOperator": "LessThan",
              "threshold": 2,
              "metricTriggerType": "Total",
              "metricColumn": "user_Id"
            }
          },
          "aznsAction": {
            "actionGroup": [],
            "emailSubject": "Email Header",
            "customWebhookPayload": "{}"
          }
        }
      }
    },
    {
      "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo",
      "name": "logalertfoo",
      "type": "Microsoft.Insights/scheduledQueryRules",
      "location": "West US",
      "tags": {},
      "properties": {
        "description": "log alert description",
        "enabled": "true",
        "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z",
        "provisioningState": "Succeeded",
        "source": {
          "query": "requests",
          "queryType": "ResultCount",
          "dataSourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI"
        },
        "schedule": {
          "frequencyInMinutes": 10,
          "timeWindowInMinutes": 30
        },
        "action": {
          "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction",
          "severity": "1",
          "trigger": {
            "thresholdOperator": "GreaterThan",
            "threshold": 3
          },
          "aznsAction": {
            "actionGroup": [],
            "emailSubject": "Email Header",
            "customWebhookPayload": "{}"
          }
        }
      }
    }
  ]
}

定義

名前 説明
AlertingAction

ルールの種類が [アラート] の場合に実行する必要があるアクションを指定する

AlertSeverity

アラートの重大度レベル

AzNsActionGroup

Azure のアクション グループ

ConditionalOperator

結果条件の評価条件。

Criteria

ログをメトリックに変換するための条件を指定します。

Dimension

ログをメトリックに変換するための条件を指定します。

enabled

ログ検索ルールが有効かどうかを示すフラグ。 値は true または false にする必要があります

ErrorContract

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

ErrorResponse

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

LogMetricTrigger

ログ メトリックトリガー記述子。

LogSearchRuleResource

ログ検索ルール リソース。

LogSearchRuleResourceCollection

ログ検索ルール リソースのコレクションを表します。

LogToMetricAction

ルールの種類がログをメトリックに変換するときに実行する必要があるアクションを指定する

metricTriggerType

メトリック トリガーの種類 - "連続" または "合計"

operator

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

provisioningState

スケジュールされたクエリ ルールのプロビジョニング状態

QueryType

値を 'ResultAccount' に設定する

Schedule

検索を実行する頻度と時間間隔を定義します。

Source

ログ検索クエリを指定します。

TriggerCondition

ログ検索ルールの結果の条件。

AlertingAction

ルールの種類が [アラート] の場合に実行する必要があるアクションを指定する

名前 説明
aznsAction

AzNsActionGroup

Azure アクション グループリファレンス。

odata.type string:

Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction

アクションを指定します。 サポートされている値 - AlertingAction、LogToMetricAction

severity

AlertSeverity

アラートの重大度

throttlingInMin

integer

アラートを調整または抑制する必要がある時間 (分単位)。

trigger

TriggerCondition

アラート ルールが発生するトリガー条件。

AlertSeverity

アラートの重大度レベル

名前 説明
0

string

1

string

2

string

3

string

4

string

AzNsActionGroup

Azure のアクション グループ

名前 説明
actionGroup

string[]

Azure Action Group リファレンス。

customWebhookPayload

string

Azure アクション グループ内のすべての Webhook URI に対して送信されるカスタム ペイロード

emailSubject

string

Azure アクション グループ内のすべての電子メール ID のカスタム件名のオーバーライド

ConditionalOperator

結果条件の評価条件。

名前 説明
Equal

string

GreaterThan

string

GreaterThanOrEqual

string

LessThan

string

LessThanOrEqual

string

Criteria

ログをメトリックに変換するための条件を指定します。

名前 説明
dimensions

Dimension[]

メトリックを作成するためのディメンションの一覧

metricName

string

メトリックの名前

Dimension

ログをメトリックに変換するための条件を指定します。

名前 説明
name

string

ディメンションの名前

operator

operator

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

values

string[]

ディメンション値の一覧

enabled

ログ検索ルールが有効かどうかを示すフラグ。 値は true または false にする必要があります

名前 説明
false

string

true

string

ErrorContract

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

名前 説明
error

ErrorResponse

エラーの詳細です。

ErrorResponse

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

名前 説明
code

string

エラー コード

message

string

操作が失敗した理由を示すエラー メッセージ。

LogMetricTrigger

ログ メトリックトリガー記述子。

名前 規定値 説明
metricColumn

string

特定の列のメトリックの評価

metricTriggerType

metricTriggerType

Consecutive

メトリック トリガーの種類 - "連続" または "合計"

threshold

number

メトリック トリガーのしきい値。

thresholdOperator

ConditionalOperator

GreaterThanOrEqual

メトリック -'GreaterThan' または 'LessThan' または 'Equal' の評価操作。

LogSearchRuleResource

ログ検索ルール リソース。

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

Azure リソース ID

kind

string

同じ種類のリソースに対して異なる UX エクスペリエンスをレンダリングするためにポータル/ツール/etc によって使用されるメタデータ。たとえば、ApiApps は Microsoft.Web/sites の種類の一種です。 サポートされている場合、リソース プロバイダーはこの値を検証して保持する必要があります。

location

string

リソースの場所

name

string

Azure リソース名

properties.action Action:

ルールの実行に対してアクションを実行する必要があります。

properties.autoMitigate

boolean

False

アラートを自動的に解決するかどうかを示すフラグ。 既定値は false です。

properties.createdWithApiVersion

string

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

properties.description

string

ログ検索ルールの説明。

properties.displayName

string

アラート ルールの表示名

properties.enabled

enabled

ログ検索ルールが有効かどうかを示すフラグ。 値は true または false にする必要があります

properties.isLegacyLogAnalyticsRule

boolean

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

properties.lastUpdatedTime

string

ルールが最後にIS08601形式で更新されたとき。

properties.provisioningState

provisioningState

スケジュールされたクエリ ルールのプロビジョニング状態

properties.schedule

Schedule

ルールのスケジュール (頻度、時間枠)。 アクションの種類に必須 - AlertingAction

properties.source

Source

データのクエリを実行するルールに対するデータ ソース

tags

object

リソース タグ

type

string

Azure リソースタイプ

LogSearchRuleResourceCollection

ログ検索ルール リソースのコレクションを表します。

名前 説明
value

LogSearchRuleResource[]

ログ検索ルール リソースの値。

LogToMetricAction

ルールの種類がログをメトリックに変換するときに実行する必要があるアクションを指定する

名前 説明
criteria

Criteria[]

メトリックの条件

odata.type string:

Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction

アクションを指定します。 サポートされている値 - AlertingAction、LogToMetricAction

metricTriggerType

メトリック トリガーの種類 - "連続" または "合計"

名前 説明
Consecutive

string

Total

string

operator

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

名前 説明
Include

string

provisioningState

スケジュールされたクエリ ルールのプロビジョニング状態

名前 説明
Canceled

string

Deploying

string

Failed

string

Succeeded

string

QueryType

値を 'ResultAccount' に設定する

名前 説明
ResultCount

string

Schedule

検索を実行する頻度と時間間隔を定義します。

名前 説明
frequencyInMinutes

integer

ルールの条件を評価する頻度 (分単位)。

timeWindowInMinutes

integer

クエリに対してデータをフェッチする必要がある時間枠 (frequencyInMinutes 以上にする必要があります)。

Source

ログ検索クエリを指定します。

名前 説明
authorizedResources

string[]

クエリに参照されるリソースの一覧

dataSourceId

string

ログ検索クエリを実行するリソース URI。

query

string

ログ検索クエリ。 アクションの種類に必須 - AlertingAction

queryType

QueryType

値を 'ResultCount' に設定します。

TriggerCondition

ログ検索ルールの結果の条件。

名前 規定値 説明
metricTrigger

LogMetricTrigger

メトリック クエリ ルールのトリガー条件

threshold

number

トリガーする必要があるルールに基づく結果またはカウントのしきい値。

thresholdOperator

ConditionalOperator

GreaterThanOrEqual

ルールの評価操作 - 'GreaterThan' または 'LessThan。