次の方法で共有


Query - Batch

Analytics クエリのバッチを実行する
データに対して Analytics クエリのバッチを実行します。 ここで は、分析クエリで POST を使用する例です。

POST https://api.loganalytics.io/v1/$batch

要求本文

名前 必須 説明
requests True

batchQueryRequest[]

バッチ内の 1 つの要求。

応答

名前 説明
200 OK

batchResponse

わかりました。 API 呼び出しが成功し、Analytics クエリの結果が応答ペイロードに含まれる

Other Status Codes

errorResponse

エラー応答オブジェクト。

セキュリティ

oauth2

Azure Active Directory OAuth2 フロー

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

スコープ

名前 説明
user_impersonation ユーザー アカウントを偽装する

metadataPost

要求のサンプル

POST https://api.loganalytics.io/v1/$batch

{
  "requests": [
    {
      "id": "1",
      "body": {
        "query": "AppRequests | take 2"
      },
      "path": "/query",
      "method": "POST",
      "workspace": "d2d0e126-fa1e-4b0a-b647-250cdd471e68"
    },
    {
      "id": "2",
      "body": {
        "query": "AppRequests | take 3"
      },
      "path": "/query",
      "method": "POST",
      "workspace": "d2d0e126-fa1e-4b0a-b647-250cdd471e68"
    }
  ]
}

応答のサンプル

{
  "responses": [
    {
      "id": "1",
      "status": 200,
      "body": {
        "tables": [
          {
            "name": "PrimaryResult",
            "columns": [
              {
                "name": "TenantId",
                "type": "string"
              },
              {
                "name": "TimeGenerated",
                "type": "datetime"
              },
              {
                "name": "Id",
                "type": "string"
              },
              {
                "name": "Source",
                "type": "string"
              },
              {
                "name": "Name",
                "type": "string"
              },
              {
                "name": "Url",
                "type": "string"
              },
              {
                "name": "Success",
                "type": "bool"
              },
              {
                "name": "ResultCode",
                "type": "string"
              },
              {
                "name": "DurationMs",
                "type": "real"
              },
              {
                "name": "PerformanceBucket",
                "type": "string"
              },
              {
                "name": "Properties",
                "type": "dynamic"
              },
              {
                "name": "Measurements",
                "type": "dynamic"
              },
              {
                "name": "OperationName",
                "type": "string"
              },
              {
                "name": "OperationId",
                "type": "string"
              },
              {
                "name": "OperationLinks",
                "type": "dynamic"
              },
              {
                "name": "ParentId",
                "type": "string"
              },
              {
                "name": "SyntheticSource",
                "type": "string"
              },
              {
                "name": "SessionId",
                "type": "string"
              },
              {
                "name": "UserId",
                "type": "string"
              },
              {
                "name": "UserAuthenticatedId",
                "type": "string"
              },
              {
                "name": "UserAccountId",
                "type": "string"
              },
              {
                "name": "AppVersion",
                "type": "string"
              },
              {
                "name": "AppRoleName",
                "type": "string"
              },
              {
                "name": "AppRoleInstance",
                "type": "string"
              },
              {
                "name": "ClientType",
                "type": "string"
              },
              {
                "name": "ClientModel",
                "type": "string"
              },
              {
                "name": "ClientOS",
                "type": "string"
              },
              {
                "name": "ClientIP",
                "type": "string"
              },
              {
                "name": "ClientCity",
                "type": "string"
              },
              {
                "name": "ClientStateOrProvince",
                "type": "string"
              },
              {
                "name": "ClientCountryOrRegion",
                "type": "string"
              },
              {
                "name": "ClientBrowser",
                "type": "string"
              },
              {
                "name": "ResourceGUID",
                "type": "string"
              },
              {
                "name": "IKey",
                "type": "string"
              },
              {
                "name": "SDKVersion",
                "type": "string"
              },
              {
                "name": "ItemCount",
                "type": "int"
              },
              {
                "name": "ReferencedItemId",
                "type": "string"
              },
              {
                "name": "ReferencedType",
                "type": "string"
              },
              {
                "name": "SourceSystem",
                "type": "string"
              },
              {
                "name": "Type",
                "type": "string"
              },
              {
                "name": "_ResourceId",
                "type": "string"
              }
            ],
            "rows": [
              [
                "d2d0e126-fa1e-4b0a-b647-250cdd471e68",
                "2021-06-02T00:18:13.317Z",
                "a3273b160f86b5c4",
                "",
                "ServiceBus.process",
                "",
                true,
                "200",
                0,
                "<250ms",
                "{\"x-opt-enqueued-time\":\"1622593091\"}",
                null,
                "ServiceBus.process",
                "e5d21caf619d4ef564a4b5920cadce47",
                null,
                "c6864f9d3649f302",
                "",
                "",
                "",
                "",
                "",
                "",
                "",
                "srikanta",
                "PC",
                "",
                "",
                "0.0.0.0",
                "Edmonds",
                "Washington",
                "United States",
                "",
                "fc5f5a5d-d6d1-47f9-be1b-aa57185ec6be",
                "b4f83947-968d-4e2f-82ad-804be07697ae",
                "java:3.1.1-BETA.2",
                1,
                "",
                "",
                "Azure",
                "AppRequests",
                "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourcegroups/srnagar-azuresdkgroup/providers/microsoft.insights/components/srnagarappinsights"
              ],
              [
                "d2d0e126-fa1e-4b0a-b647-250cdd471e68",
                "2021-06-02T00:19:13.44Z",
                "bebb49e7a1344c07",
                "",
                "ServiceBus.process",
                "",
                true,
                "200",
                0,
                "<250ms",
                "{\"x-opt-enqueued-time\":\"1622593091\"}",
                null,
                "ServiceBus.process",
                "d76c6dec50d2c12267d7d3a246a0c237",
                null,
                "b68fff4775c77214",
                "",
                "",
                "",
                "",
                "",
                "",
                "",
                "srikanta",
                "PC",
                "",
                "",
                "0.0.0.0",
                "Edmonds",
                "Washington",
                "United States",
                "",
                "fc5f5a5d-d6d1-47f9-be1b-aa57185ec6be",
                "b4f83947-968d-4e2f-82ad-804be07697ae",
                "java:3.1.1-BETA.2",
                1,
                "",
                "",
                "Azure",
                "AppRequests",
                "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourcegroups/srnagar-azuresdkgroup/providers/microsoft.insights/components/srnagarappinsights"
              ]
            ]
          }
        ]
      }
    },
    {
      "id": "2",
      "status": 200,
      "body": {
        "tables": [
          {
            "name": "PrimaryResult",
            "columns": [
              {
                "name": "TenantId",
                "type": "string"
              },
              {
                "name": "TimeGenerated",
                "type": "datetime"
              },
              {
                "name": "Id",
                "type": "string"
              },
              {
                "name": "Source",
                "type": "string"
              },
              {
                "name": "Name",
                "type": "string"
              },
              {
                "name": "Url",
                "type": "string"
              },
              {
                "name": "Success",
                "type": "bool"
              },
              {
                "name": "ResultCode",
                "type": "string"
              },
              {
                "name": "DurationMs",
                "type": "real"
              },
              {
                "name": "PerformanceBucket",
                "type": "string"
              },
              {
                "name": "Properties",
                "type": "dynamic"
              },
              {
                "name": "Measurements",
                "type": "dynamic"
              },
              {
                "name": "OperationName",
                "type": "string"
              },
              {
                "name": "OperationId",
                "type": "string"
              },
              {
                "name": "OperationLinks",
                "type": "dynamic"
              },
              {
                "name": "ParentId",
                "type": "string"
              },
              {
                "name": "SyntheticSource",
                "type": "string"
              },
              {
                "name": "SessionId",
                "type": "string"
              },
              {
                "name": "UserId",
                "type": "string"
              },
              {
                "name": "UserAuthenticatedId",
                "type": "string"
              },
              {
                "name": "UserAccountId",
                "type": "string"
              },
              {
                "name": "AppVersion",
                "type": "string"
              },
              {
                "name": "AppRoleName",
                "type": "string"
              },
              {
                "name": "AppRoleInstance",
                "type": "string"
              },
              {
                "name": "ClientType",
                "type": "string"
              },
              {
                "name": "ClientModel",
                "type": "string"
              },
              {
                "name": "ClientOS",
                "type": "string"
              },
              {
                "name": "ClientIP",
                "type": "string"
              },
              {
                "name": "ClientCity",
                "type": "string"
              },
              {
                "name": "ClientStateOrProvince",
                "type": "string"
              },
              {
                "name": "ClientCountryOrRegion",
                "type": "string"
              },
              {
                "name": "ClientBrowser",
                "type": "string"
              },
              {
                "name": "ResourceGUID",
                "type": "string"
              },
              {
                "name": "IKey",
                "type": "string"
              },
              {
                "name": "SDKVersion",
                "type": "string"
              },
              {
                "name": "ItemCount",
                "type": "int"
              },
              {
                "name": "ReferencedItemId",
                "type": "string"
              },
              {
                "name": "ReferencedType",
                "type": "string"
              },
              {
                "name": "SourceSystem",
                "type": "string"
              },
              {
                "name": "Type",
                "type": "string"
              },
              {
                "name": "_ResourceId",
                "type": "string"
              }
            ],
            "rows": [
              [
                "d2d0e126-fa1e-4b0a-b647-250cdd471e68",
                "2021-06-02T16:31:25.383Z",
                "08bf242cdc68504c",
                "",
                "ServiceBus.process",
                "",
                true,
                "200",
                0,
                "<250ms",
                "{\"x-opt-enqueued-time\":\"1622651483\"}",
                null,
                "ServiceBus.process",
                "65d9eb1ccf85b1b7ed1e2ea6bb72f563",
                null,
                "146140ce8493a6ed",
                "",
                "",
                "",
                "",
                "",
                "",
                "",
                "srikanta",
                "PC",
                "",
                "",
                "0.0.0.0",
                "Edmonds",
                "Washington",
                "United States",
                "",
                "fc5f5a5d-d6d1-47f9-be1b-aa57185ec6be",
                "b4f83947-968d-4e2f-82ad-804be07697ae",
                "java:3.1.1-BETA.2",
                1,
                "",
                "",
                "Azure",
                "AppRequests",
                "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourcegroups/srnagar-azuresdkgroup/providers/microsoft.insights/components/srnagarappinsights"
              ],
              [
                "d2d0e126-fa1e-4b0a-b647-250cdd471e68",
                "2021-06-02T16:32:25.492Z",
                "9f4cd78c10d57b4f",
                "",
                "ServiceBus.process",
                "",
                true,
                "200",
                0,
                "<250ms",
                "{\"x-opt-enqueued-time\":\"1622651483\"}",
                null,
                "ServiceBus.process",
                "ae054fe7b7ac3adf8b841ebbe1ecb912",
                null,
                "14eab103a1969665",
                "",
                "",
                "",
                "",
                "",
                "",
                "",
                "srikanta",
                "PC",
                "",
                "",
                "0.0.0.0",
                "Edmonds",
                "Washington",
                "United States",
                "",
                "fc5f5a5d-d6d1-47f9-be1b-aa57185ec6be",
                "b4f83947-968d-4e2f-82ad-804be07697ae",
                "java:3.1.1-BETA.2",
                1,
                "",
                "",
                "Azure",
                "AppRequests",
                "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourcegroups/srnagar-azuresdkgroup/providers/microsoft.insights/components/srnagarappinsights"
              ],
              [
                "d2d0e126-fa1e-4b0a-b647-250cdd471e68",
                "2021-06-02T16:33:25.585Z",
                "ea7e09d4baa4e4ce",
                "",
                "ServiceBus.process",
                "",
                true,
                "200",
                0,
                "<250ms",
                "{\"x-opt-enqueued-time\":\"1622651483\"}",
                null,
                "ServiceBus.process",
                "ba6162e3ccd803086944750b82600a3a",
                null,
                "b60455183860caaf",
                "",
                "",
                "",
                "",
                "",
                "",
                "",
                "srikanta",
                "PC",
                "",
                "",
                "0.0.0.0",
                "Edmonds",
                "Washington",
                "United States",
                "",
                "fc5f5a5d-d6d1-47f9-be1b-aa57185ec6be",
                "b4f83947-968d-4e2f-82ad-804be07697ae",
                "java:3.1.1-BETA.2",
                1,
                "",
                "",
                "Azure",
                "AppRequests",
                "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourcegroups/srnagar-azuresdkgroup/providers/microsoft.insights/components/srnagarappinsights"
              ]
            ]
          }
        ]
      }
    }
  ]
}

定義

名前 説明
batchQueryRequest

バッチ内の 1 つの要求。

batchQueryResponse
batchQueryResults

バッチ内の 1 つのクエリに対するクエリ応答。

batchRequest

要求の配列。

batchResponse

バッチ クエリへの応答。

column

テーブル列。

errorDetail

エラーの詳細。

errorInfo

エラーのコードとメッセージ。

errorResponse

エラーの詳細。

logsColumnType

この列のデータ型。

methodType
path
queryBody

Analytics クエリ。 Analytics クエリ構文の詳細については、

Render

JSON 形式の視覚化データ。

Statistics

JSON 形式で表される統計。

table

クエリ応答テーブル。

batchQueryRequest

バッチ内の 1 つの要求。

名前 説明
body

queryBody

Analytics クエリ。 Analytics クエリ構文の詳細については、

headers

object

id

string

エラーの詳細。

method

methodType

path

path

workspace

string

クエリに含めるワークスペース ID

batchQueryResponse

名前 説明
body

batchQueryResults

バッチ内の 1 つのクエリに対するクエリ応答。
クエリの結果の行 & テーブル、列が含まれます。

headers

object

id

string

status

integer (int64)

batchQueryResults

バッチ内の 1 つのクエリに対するクエリ応答。

名前 説明
error

errorInfo

エラーのコードとメッセージ。

render

Render

JSON 形式の視覚化データ。

statistics

Statistics

JSON 形式で表される統計。

tables

table[]

テーブル、列、行の一覧。

batchRequest

要求の配列。

名前 説明
requests

batchQueryRequest[]

バッチ内の 1 つの要求。

batchResponse

バッチ クエリへの応答。

名前 説明
responses

batchQueryResponse[]

バッチ内の個々の要求に対応する応答の配列。

column

テーブル列。

名前 説明
name

string

この列の名前。

type

logsColumnType

この列のデータ型。

errorDetail

エラーの詳細。

名前 説明
additionalProperties

object

エラーの詳細オブジェクトに指定できる追加のプロパティ

code

string

エラーのコード。

message

string

人間が判読できるエラー メッセージ。

resources

string[]

エラーの原因となったリソースを示します。

target

string

要求のどのプロパティがエラーの原因であるかを示します。

value

string

エラーの原因となる 'target' の値を示します。

errorInfo

エラーのコードとメッセージ。

名前 説明
additionalProperties

object

エラー情報オブジェクトに指定できる追加のプロパティ

code

string

コンピューターが読み取り可能なエラー コード。

details

errorDetail[]

エラーの詳細。

innererror

errorInfo

エラーのコードとメッセージ。
内部エラーの詳細 (存在する場合)。

message

string

人間が判読できるエラー メッセージ。

errorResponse

エラーの詳細。

名前 説明
error

errorInfo

エラーのコードとメッセージ。
エラーの詳細。

logsColumnType

この列のデータ型。

説明
bool
datetime
decimal
dynamic
guid
int
long
real
string
timespan

methodType

説明
POST

path

説明
/query

queryBody

Analytics クエリ。 Analytics クエリ構文の詳細については、

名前 説明
query

string

実行するクエリ。

timespan

string

随意。 データのクエリを実行する期間。 これは、ISO8601期間の値です。 この期間は、クエリ式で指定された期間に加えて適用されます。

workspaces

string[]

クエリに含まれるワークスペースの一覧。

Render

JSON 形式の視覚化データ。

Statistics

JSON 形式で表される統計。

table

クエリ応答テーブル。

名前 説明
columns

column[]

このテーブル内の列の一覧。

name

string

テーブルの名前。

rows

object[]

このクエリの結果の行。