次の方法で共有


Query Pack Queries - Put

Log Analytics QueryPack 内の特定のクエリを追加または更新します。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}?api-version=2019-09-01

URI パラメーター

名前 / 必須 説明
id
path True

string

Log Analytics QueryPack で定義されている特定のクエリの ID

queryPackName
path True

string

Log Analytics QueryPack リソースの名前。

resourceGroupName
path True

string

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

subscriptionId
path True

string

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

api-version
query True

string

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

要求本文

名前 必須 説明
properties.body True

string

クエリの本文。

properties.displayName True

string

クエリ パック内のクエリの一意の表示名。

properties.description

string

クエリの説明。

properties.properties

object

クエリに設定できる追加のプロパティ。

properties.related

Related

関数の関連メタデータ項目。

properties.tags

object

クエリに関連付けられているタグ。

応答

名前 説明
200 OK

LogAnalyticsQueryPackQuery

Log Analytics QueryPack に含まれる新しいクエリまたは更新されたクエリ。

Other Status Codes

ErrorResponse

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

セキュリティ

azure_auth

Azure Active Directory OAuth2 フロー

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

Scopes

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

QueryPut

Sample Request

PUT https://management.azure.com/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/Microsoft.OperationalInsights/queryPacks/my-querypack/queries/a449f8af-8e64-4b3a-9b16-5a7165ff98c4?api-version=2019-09-01

{
  "properties": {
    "displayName": "Exceptions - New in the last 24 hours",
    "description": "my description",
    "body": "let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  \n) on problemId \n| order by  count_ desc\n",
    "related": {
      "categories": [
        "analytics"
      ]
    },
    "tags": {
      "my-label": [
        "label1"
      ],
      "my-other-label": [
        "label2"
      ]
    }
  }
}

Sample Response

{
  "id": "/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/a449f8af-8e64-4b3a-9b16-5a7165ff98c4",
  "name": "a449f8af-8e64-4b3a-9b16-5a7165ff98c4",
  "type": "microsoft.operationalinsights/queryPacks/queries",
  "systemData": {
    "createdBy": "string",
    "createdByType": "application",
    "createdAt": "2020-02-03T01:01:01.1075056Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "application",
    "lastModifiedAt": "2020-02-04T02:03:01.1974346Z"
  },
  "properties": {
    "id": "a449f8af-8e64-4b3a-9b16-5a7165ff98c4",
    "timeCreated": "2019-08-15T10:30:32.5742324Z",
    "author": "1809f206-263a-46f7-942d-4572c156b7e7",
    "timeModified": "2019-08-15T10:30:32.5742324Z",
    "displayName": "Exceptions - New in the last 24 hours",
    "description": "my description",
    "body": "let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  \n) on problemId \n| order by  count_ desc\n",
    "related": {
      "categories": [
        "analytics"
      ]
    },
    "tags": {
      "my-label": [
        "label1"
      ],
      "my-other-label": [
        "label2"
      ]
    }
  }
}

定義

名前 説明
ErrorAdditionalInfo

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

ErrorDetail

エラーの詳細。

ErrorResponse

エラー応答

IdentityType

リソースを作成または変更する ID の種類

LogAnalyticsQueryPackQuery

Log Analytics QueryPack-Query 定義。

Related

関数の関連メタデータ項目。

SystemData

システム データの読み取り専用

ErrorAdditionalInfo

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

名前 説明
info

object

追加情報。

type

string

追加情報の種類。

ErrorDetail

エラーの詳細。

名前 説明
additionalInfo

ErrorAdditionalInfo[]

エラーの追加情報。

code

string

エラー コード。

details

ErrorDetail[]

エラーの詳細です。

message

string

エラー メッセージ。

target

string

エラーのターゲット。

ErrorResponse

エラー応答

名前 説明
error

ErrorDetail

error オブジェクト。

IdentityType

リソースを作成または変更する ID の種類

名前 説明
application

string

key

string

managedIdentity

string

user

string

LogAnalyticsQueryPackQuery

Log Analytics QueryPack-Query 定義。

名前 説明
id

string

Azure リソース ID

name

string

Azure リソース名

properties.author

string

クエリを作成するユーザーのオブジェクト ID。

properties.body

string

クエリの本文。

properties.description

string

クエリの説明。

properties.displayName

string

クエリ パック内のクエリの一意の表示名。

properties.id

string

アプリケーションの一意の ID。 このフィールドは変更できません。

properties.properties

object

クエリに設定できる追加のプロパティ。

properties.related

Related

関数の関連メタデータ項目。

properties.tags

object

クエリに関連付けられているタグ。

properties.timeCreated

string

Log Analytics クエリの作成日 (ISO 8601 形式)。

properties.timeModified

string

Log Analytics クエリの最終更新日 (ISO 8601 形式)。

systemData

SystemData

システム データの読み取り専用

type

string

Azure リソースタイプ

関数の関連メタデータ項目。

名前 説明
categories

string[]

関数の関連カテゴリ。

resourceTypes

string[]

関数の関連リソースの種類。

solutions

string[]

関数の関連する Log Analytics ソリューション。

SystemData

システム データの読み取り専用

名前 説明
createdAt

string

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

createdBy

string

リソースを作成した ID の識別子

createdByType

IdentityType

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

lastModifiedAt

string

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

lastModifiedBy

string

リソースを最後に変更した ID の識別子

lastModifiedByType

IdentityType

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