Query Pack Queries - Put
Aggiunge o Aggiornamenti una query specifica all'interno di una query di Log Analytics QueryPack.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}?api-version=2019-09-01
Parametri dell'URI
Nome | In | Necessario | Tipo | Descrizione |
---|---|---|---|---|
id
|
path | True |
string |
ID di una query specifica definita in Log Analytics QueryPack |
query
|
path | True |
string |
Nome della risorsa QueryPack di Log Analytics. |
resource
|
path | True |
string |
Nome del gruppo di risorse. Per il nome non viene fatta distinzione tra maiuscole e minuscole. |
subscription
|
path | True |
string |
ID della sottoscrizione di destinazione. |
api-version
|
query | True |
string |
Versione dell'API da usare per questa operazione. |
Corpo della richiesta
Nome | Necessario | Tipo | Descrizione |
---|---|---|---|
properties.body | True |
string |
Corpo della query. |
properties.displayName | True |
string |
Nome visualizzato univoco per la query all'interno di Query Pack. |
properties.description |
string |
Descrizione della query. |
|
properties.properties |
object |
Proprietà aggiuntive che possono essere impostate per la query. |
|
properties.related |
Elementi di metadati correlati per la funzione. |
||
properties.tags |
object |
Tag associati alla query. |
Risposte
Nome | Tipo | Descrizione |
---|---|---|
200 OK |
La query nuova o aggiornata contenuta in Log Analytics QueryPack. |
|
Other Status Codes |
Risposta di errore che descrive perché l'operazione non è riuscita. |
Sicurezza
azure_auth
Flusso OAuth2 di Azure Active Directory
Tipo:
oauth2
Flow:
implicit
URL di autorizzazione:
https://login.microsoftonline.com/common/oauth2/authorize
Ambiti
Nome | Descrizione |
---|---|
user_impersonation | rappresentare l'account utente |
Esempio
QueryPut
Esempio di richiesta
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"
]
}
}
}
Risposta di esempio
{
"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"
]
}
}
}
Definizioni
Nome | Descrizione |
---|---|
Error |
Informazioni aggiuntive sulla gestione delle risorse. |
Error |
Dettagli dell'errore. |
Error |
Risposta di errore |
Identity |
Tipo di identità che crea/modifica le risorse |
Log |
Definizione di Log Analytics QueryPack-Query. |
Related |
Elementi di metadati correlati per la funzione. |
System |
Leggere solo i dati di sistema |
ErrorAdditionalInfo
Informazioni aggiuntive sulla gestione delle risorse.
Nome | Tipo | Descrizione |
---|---|---|
info |
object |
Informazioni aggiuntive. |
type |
string |
Tipo di informazioni aggiuntive. |
ErrorDetail
Dettagli dell'errore.
Nome | Tipo | Descrizione |
---|---|---|
additionalInfo |
Informazioni aggiuntive sull'errore. |
|
code |
string |
Codice di errore. |
details |
Dettagli dell'errore. |
|
message |
string |
Messaggio di errore. |
target |
string |
Destinazione dell'errore. |
ErrorResponse
Risposta di errore
Nome | Tipo | Descrizione |
---|---|---|
error |
Oggetto error. |
IdentityType
Tipo di identità che crea/modifica le risorse
Nome | Tipo | Descrizione |
---|---|---|
application |
string |
|
key |
string |
|
managedIdentity |
string |
|
user |
string |
LogAnalyticsQueryPackQuery
Definizione di Log Analytics QueryPack-Query.
Nome | Tipo | Descrizione |
---|---|---|
id |
string |
ID risorsa di Azure |
name |
string |
Nome risorsa di Azure |
properties.author |
string |
ID oggetto dell'utente che crea la query. |
properties.body |
string |
Corpo della query. |
properties.description |
string |
Descrizione della query. |
properties.displayName |
string |
Nome visualizzato univoco per la query all'interno di Query Pack. |
properties.id |
string |
ID univoco dell'applicazione. Impossibile modificare questo campo. |
properties.properties |
object |
Proprietà aggiuntive che possono essere impostate per la query. |
properties.related |
Elementi di metadati correlati per la funzione. |
|
properties.tags |
object |
Tag associati alla query. |
properties.timeCreated |
string |
Data di creazione per la query log analytics in formato ISO 8601. |
properties.timeModified |
string |
Ultima data modificata della query di Log Analytics, in formato ISO 8601. |
systemData |
Leggere solo i dati di sistema |
|
type |
string |
Tipo di risorsa di Azure |
Related
Elementi di metadati correlati per la funzione.
Nome | Tipo | Descrizione |
---|---|---|
categories |
string[] |
Categorie correlate per la funzione. |
resourceTypes |
string[] |
Tipi di risorse correlati per la funzione. |
solutions |
string[] |
Le soluzioni di Log Analytics correlate per la funzione. |
SystemData
Leggere solo i dati di sistema
Nome | Tipo | Descrizione |
---|---|---|
createdAt |
string |
Timestamp della creazione della risorsa (UTC) |
createdBy |
string |
Identificatore per l'identità che ha creato la risorsa |
createdByType |
Tipo di identità che ha creato la risorsa |
|
lastModifiedAt |
string |
Timestamp dell'ultima modifica della risorsa (UTC) |
lastModifiedBy |
string |
Identificatore per l'identità che ha modificato l'ultima risorsa |
lastModifiedByType |
Tipo di identità che ha modificato l'ultima risorsa |