Query Pack Queries - Search
根据给定的搜索属性搜索 Log Analytics QueryPack 中定义的查询列表。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/search?api-version=2019-09-01
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/search?api-version=2019-09-01&$top={$top}&includeBody={includeBody}&$skipToken={$skipToken}
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
query
|
path | True |
string |
Log Analytics QueryPack 资源的名称。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 名称不区分大小写。 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
api-version
|
query | True |
string minLength: 1 |
用于此作的 API 版本。 |
|
$skip
|
query |
string |
用于提取下一页项的 Base64 编码令牌。 默认值为 null。 |
|
|
$top
|
query |
integer (int64) |
页中返回的最大项目数。 |
|
|
include
|
query |
boolean |
指示是否返回每个适用查询的正文的标志。 如果为 false,则仅返回查询信息。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| related |
函数的相关元数据项。 |
|
| tags |
object |
与查询关联的标记。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
包含 Log Analytics QueryPack 中包含的 0 个或多个查询的列表。 |
|
| Other Status Codes |
描述操作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
QuerySearch
示例请求
POST https://management.azure.com/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/Microsoft.OperationalInsights/queryPacks/my-querypack/queries/search?api-version=2019-09-01&$top=3&includeBody=True
{
"related": {
"categories": [
"other",
"analytics"
]
},
"tags": {
"my-label": [
"label1"
]
}
}
示例响应
{
"value": [
{
"id": "/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/4337bb16-d6fe-4ff7-97cf-59df25941476",
"name": "4337bb16-d6fe-4ff7-97cf-59df25941476",
"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": "4337bb16-d6fe-4ff7-97cf-59df25941476",
"timeCreated": "2019-08-15T10:29:56.1030254Z",
"author": "1809f206-263a-46f7-942d-4572c156b7e7",
"timeModified": "2019-08-15T10:29:56.1030254Z",
"displayName": "Heartbeat_1",
"description": "Thie query takes 10 entries of heartbeat 0",
"body": "Heartbeat | take 1",
"related": {
"categories": [
"other"
]
},
"tags": {
"my-label": [
"label1"
],
"my-other-label": [
"label2"
]
}
}
},
{
"id": "/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/bf015bf7-be70-49c2-8d52-4cce85c42ef1",
"name": "bf015bf7-be70-49c2-8d52-4cce85c42ef1",
"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": "bf015bf7-be70-49c2-8d52-4cce85c42ef1",
"timeCreated": "2019-08-15T10:30:26.7943629Z",
"author": "1809f206-263a-46f7-942d-4572c156b7e7",
"timeModified": "2019-08-15T10:30:26.7943629Z",
"displayName": "Heartbeat_2",
"description": "Thie query takes 10 entries of heartbeat 1",
"body": "Heartbeat | take 1",
"related": {
"categories": [
"analytics"
]
},
"tags": {
"my-label": [
"label1"
],
"my-other-label": [
"label2"
]
}
}
},
{
"id": "/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/8d91c6ca-9c56-49c6-b3ae-112a68871acd",
"name": "8d91c6ca-9c56-49c6-b3ae-112a68871acd",
"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": "8d91c6ca-9c56-49c6-b3ae-112a68871acd",
"timeCreated": "2019-08-15T10:30:29.4505584Z",
"author": "1809f206-263a-46f7-942d-4572c156b7e7",
"timeModified": "2019-08-15T10:30:29.4505584Z",
"displayName": "Heartbeat_3",
"description": "Thie query takes 10 entries of heartbeat 2",
"body": "Heartbeat | take 1",
"related": {
"categories": [
"other",
"analytics"
]
},
"tags": {
"my-label": [
"label1"
],
"my-other-label": [
"label2"
]
}
}
}
],
"nextLink": null
}
定义
| 名称 | 说明 |
|---|---|
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
Identity |
创建/修改资源的标识类型 |
|
Log |
Log Analytics QueryPack-Query 定义。 |
|
Log |
描述 Log Analytics QueryPack-Query 资源的列表。 |
|
Log |
定义 Log Analytics QueryPack-Query 搜索属性的属性。 |
| Related |
函数的相关元数据项。 |
|
System |
只读系统数据 |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
IdentityType
创建/修改资源的标识类型
| 值 | 说明 |
|---|---|
| user | |
| application | |
| managedIdentity | |
| key |
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 |
函数的相关元数据项。 |
|
| properties.tags |
object |
与查询关联的标记。 |
| properties.timeCreated |
string (date-time) |
Log Analytics 查询的创建日期(采用 ISO 8601 格式)。 |
| properties.timeModified |
string (date-time) |
Log Analytics 查询的上次修改日期(采用 ISO 8601 格式)。 |
| systemData |
只读系统数据 |
|
| type |
string |
Azure 资源类型 |
LogAnalyticsQueryPackQueryListResult
描述 Log Analytics QueryPack-Query 资源的列表。
| 名称 | 类型 | 说明 |
|---|---|---|
| nextLink |
string |
如果结果集中返回的 QueryPack-Queries 太多,则获取下一组 Log Analytics QueryPack 定义的 URI。 |
| value |
Log Analytics QueryPack 查询定义列表。 |
LogAnalyticsQueryPackQuerySearchProperties
定义 Log Analytics QueryPack-Query 搜索属性的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| related |
函数的相关元数据项。 |
|
| tags |
object |
与查询关联的标记。 |
Related
函数的相关元数据项。
| 名称 | 类型 | 说明 |
|---|---|---|
| categories |
string[] |
函数的相关类别。 |
| resourceTypes |
string[] |
函数的相关资源类型。 |
| solutions |
string[] |
函数的相关 Log Analytics 解决方案。 |
SystemData
只读系统数据
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC) |
| createdBy |
string |
创建资源的标识的标识符 |
| createdByType |
创建资源的标识类型 |
|
| lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
| lastModifiedBy |
string |
上次修改资源的标识的标识符 |
| lastModifiedByType |
上次修改资源的标识类型 |