Query Pack Queries - Update
在 Log Analytics QueryPack 中添加或更新特定查询。
PATCH 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 |
|
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 版本。 |
请求正文
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| properties.body | True |
string |
查询正文。 |
| properties.displayName | True |
string |
查询包中查询的唯一显示名称。 |
| properties.description |
string |
查询的说明。 |
|
| properties.properties |
object |
可为查询设置的其他属性。 |
|
| properties.related |
函数的相关元数据项。 |
||
| properties.tags |
object |
与查询关联的标记。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
Log Analytics QueryPack 中包含的新查询或更新的查询。 |
|
| Other Status Codes |
描述操作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
QueryPatch
示例请求
PATCH 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"
]
}
}
}
示例响应
{
"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"
]
}
}
}
定义
| 名称 | 说明 |
|---|---|
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
Identity |
创建/修改资源的标识类型 |
|
Log |
Log Analytics QueryPack-Query 定义。 |
| Related |
函数的相关元数据项。 |
|
System |
只读系统数据 |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
IdentityType
创建/修改资源的标识类型
| 值 | 说明 |
|---|---|
| application | |
| key | |
| managedIdentity | |
| user |
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 资源类型 |
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 |
上次修改资源的标识类型 |