Query - Batch
Elemzési lekérdezések kötegének végrehajtása
Adatelemzési lekérdezések kötegét hajtja végre.
Íme egy példa a POST analyticses lekérdezéssel való használatára.
POST https://api.loganalytics.io/v1/$batch
Kérelem törzse
Name | Kötelező | Típus | Description |
---|---|---|---|
requests | True |
Egyetlen kérelem kötegben. |
Válaszok
Name | Típus | Description |
---|---|---|
200 OK |
OK gombra. Az API-hívás sikeres volt, és az Analytics-lekérdezés eredménye a válasz hasznos adatában van |
|
Other Status Codes |
Egy hibaválasz-objektum. |
Biztonság
oauth2
Azure Active Directory OAuth2 Flow
Típus:
oauth2
Folyamat:
implicit
Engedélyezési URL:
https://login.microsoftonline.com/common/oauth2/authorize
Hatókörök
Name | Description |
---|---|
user_impersonation | felhasználói fiók megszemélyesítése |
Példák
metadataPost
Mintakérelem
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"
}
]
}
Mintaválasz
{
"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"
]
]
}
]
}
}
]
}
Definíciók
Name | Description |
---|---|
batch |
Egyetlen kérelem kötegben. |
batch |
|
batch |
Egy kötegben lévő egyetlen lekérdezés lekérdezési válasza. |
batch |
Kérések tömbje. |
batch |
Válasz kötegelt lekérdezésre. |
column |
Egy táblázatoszlop. |
error |
Hiba részletei. |
error |
A hiba kódja és üzenete. |
error |
Hiba részletei. |
logs |
Az oszlop adattípusa. |
method |
|
path | |
query |
Az Analytics-lekérdezés. További információ az Analytics lekérdezési szintaxisáról |
Render |
Vizualizációs adatok JSON formátumban. |
Statistics |
JSON formátumban ábrázolt statisztikák. |
table |
Egy lekérdezési választáblát. |
batchQueryRequest
Egyetlen kérelem kötegben.
Name | Típus | Description |
---|---|---|
body |
Az Analytics-lekérdezés. További információ az Analytics lekérdezési szintaxisáról |
|
headers |
object |
|
id |
string |
A hiba részletei. |
method | ||
path | ||
workspace |
string |
A lekérdezésben szerepeltetni kívánt munkaterület-azonosító |
batchQueryResponse
Name | Típus | Description |
---|---|---|
body |
Egy kötegben lévő egyetlen lekérdezés lekérdezési válasza. |
|
headers |
object |
|
id |
string |
|
status |
integer |
batchQueryResults
Egy kötegben lévő egyetlen lekérdezés lekérdezési válasza.
Name | Típus | Description |
---|---|---|
error |
A hiba kódja és üzenete. |
|
render |
Vizualizációs adatok JSON formátumban. |
|
statistics |
JSON formátumban ábrázolt statisztikák. |
|
tables |
table[] |
A táblák, oszlopok és sorok listája. |
batchRequest
Kérések tömbje.
Name | Típus | Description |
---|---|---|
requests |
Egyetlen kérelem kötegben. |
batchResponse
Válasz kötegelt lekérdezésre.
Name | Típus | Description |
---|---|---|
responses |
Egy köteg minden egyes kérésének megfelelő választömb. |
column
Egy táblázatoszlop.
Name | Típus | Description |
---|---|---|
name |
string |
Az oszlop neve. |
type |
Az oszlop adattípusa. |
errorDetail
Hiba részletei.
Name | Típus | Description |
---|---|---|
additionalProperties |
object |
A hiba részletei objektumon megadható további tulajdonságok |
code |
string |
A hiba kódja. |
message |
string |
Emberi olvasásra alkalmas hibaüzenet. |
resources |
string[] |
A hibáért felelős erőforrásokat jelzi. |
target |
string |
Azt jelzi, hogy a kérelem melyik tulajdonsága felelős a hibáért. |
value |
string |
Azt jelzi, hogy a "target" melyik értéke felelős a hibáért. |
errorInfo
A hiba kódja és üzenete.
Name | Típus | Description |
---|---|---|
additionalProperties |
object |
A hibainformációs objektumon megadható további tulajdonságok |
code |
string |
Géppel olvasható hibakód. |
details |
hiba részletei. |
|
innererror |
A hiba kódja és üzenete. |
|
message |
string |
Emberi olvasásra alkalmas hibaüzenet. |
errorResponse
Hiba részletei.
Name | Típus | Description |
---|---|---|
error |
A hiba kódja és üzenete. |
logsColumnType
Az oszlop adattípusa.
Name | Típus | Description |
---|---|---|
bool |
string |
|
datetime |
string |
|
decimal |
string |
|
dynamic |
string |
|
guid |
string |
|
int |
string |
|
long |
string |
|
real |
string |
|
string |
string |
|
timespan |
string |
methodType
Name | Típus | Description |
---|---|---|
POST |
string |
path
Name | Típus | Description |
---|---|---|
/query |
string |
queryBody
Az Analytics-lekérdezés. További információ az Analytics lekérdezési szintaxisáról
Name | Típus | Description |
---|---|---|
query |
string |
A végrehajtandó lekérdezés. |
timespan |
string |
Választható. Az adatok lekérdezésének időtartománya. Ez egy ISO8601 időszak értéke. Ez az időtartomány a lekérdezési kifejezésben megadottakon kívül lesz alkalmazva. |
workspaces |
string[] |
A lekérdezésben szereplő munkaterületek listája. |
Render
Vizualizációs adatok JSON formátumban.
Statistics
JSON formátumban ábrázolt statisztikák.
table
Egy lekérdezési választáblát.
Name | Típus | Description |
---|---|---|
columns |
column[] |
A táblázat oszlopainak listája. |
name |
string |
A tábla neve. |
rows |
object[] |
A lekérdezés eredményként kapott sorai. |