Udostępnij za pośrednictwem


Zapytania dotyczące tabeli AzureDiagnostics

Zapytania dotyczące pliku microsoft.automation

Błędy w zadaniach automatyzacji

Znajdź dzienniki raportowania błędów w zadaniach automatyzacji z ostatniego dnia.

AzureDiagnostics 
| where ResourceProvider == "MICROSOFT.AUTOMATION"  
| where StreamType_s == "Error" 
| project TimeGenerated, Category, JobId_g, OperationName, RunbookName_s, ResultDescription

Znajdowanie dzienników raportowania błędów w zadaniach automatyzacji z ostatniego dnia

Wyświetl listę wszystkich błędów w zadaniach automatyzacji.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics 
| where ResourceProvider == "MICROSOFT.AUTOMATION" 
| where StreamType_s == "Error" 
| project TimeGenerated, Category, JobId_g, OperationName, RunbookName_s, ResultDescription, _ResourceId 

Azure Automation zadania, które zakończyły się niepowodzeniem, wstrzymano lub zatrzymano

Wyświetl listę wszystkich zadań automatyzacji, które zakończyły się niepowodzeniem, wstrzymane lub zatrzymane.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics 
| where ResourceProvider == "MICROSOFT.AUTOMATION" and Category == "JobLogs" and (ResultType == "Failed" or ResultType == "Stopped" or ResultType == "Suspended") 
| project TimeGenerated , RunbookName_s , ResultType , _ResourceId , JobId_g

Element Runbook został ukończony pomyślnie z błędami

Wyświetl listę wszystkich zadań zakończonych błędami.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics 
| where ResourceProvider == "MICROSOFT.AUTOMATION" and Category == "JobStreams" and StreamType_s == "Error" 
| project TimeGenerated , RunbookName_s , StreamType_s , _ResourceId , ResultDescription , JobId_g 

Wyświetlanie stanu zadania historycznego

Wyświetl listę wszystkich zadań automatyzacji.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.AUTOMATION" and Category == "JobLogs" and ResultType != "started"
| summarize AggregatedValue = count() by ResultType, bin(TimeGenerated, 1h) , RunbookName_s , JobId_g, _ResourceId

Azure Automation zadania, które są ukończone

Wyświetl listę wszystkich zadań automatyzacji, które zostały ukończone.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics 
| where ResourceProvider == "MICROSOFT.AUTOMATION" and Category == "JobLogs" and ResultType == "Completed" 
| project TimeGenerated , RunbookName_s , ResultType , _ResourceId , JobId_g 

Zapytania dotyczące usługi microsoft.batch

Pomyślne zadania na zadanie

Zawiera liczbę pomyślnych zadań na zadanie.

AzureDiagnostics
| where OperationName=="TaskCompleteEvent"
| where executionInfo_exitCode_d==0 // Your application may use an exit code other than 0 to denote a successful operation
| summarize successfulTasks=count(id_s) by jobId=jobId_s

Zadania, które zakończyły się niepowodzeniem na zadanie

Listy zadania podrzędne nie powiodły się przez zadanie nadrzędne.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where OperationName=="TaskFailEvent"
| summarize failedTaskList=make_list(id_s) by jobId=jobId_s, ResourceId

Czasy trwania zadań

Daje czas, który upłynął w sekundach, od rozpoczęcia zadania do ukończenia zadania.

AzureDiagnostics
| where OperationName=="TaskCompleteEvent"
| extend taskId=id_s, ElapsedTime=datetime_diff('second', executionInfo_endTime_t, executionInfo_startTime_t) // For longer running tasks, consider changing 'second' to 'minute' or 'hour'
| summarize taskList=make_list(taskId) by ElapsedTime

Rozmiary puli

Czasy zmiany rozmiaru listy według puli i kodu wyniku (powodzenie lub niepowodzenie).

AzureDiagnostics
| where OperationName=="PoolResizeCompleteEvent"
| summarize operationTimes=make_list(startTime_s) by poolName=id_s, resultCode=resultCode_s

Błędy zmiany rozmiaru puli

Wyświetlanie listy niepowodzeń zmiany rozmiaru puli według kodu błędu i czasu.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where OperationName=="PoolResizeCompleteEvent"
| where resultCode_s=="Failure" // Filter only on failed pool resizes
| summarize by poolName=id_s, resultCode=resultCode_s, resultMessage=resultMessage_s, operationTime=startTime_s, ResourceId

Zapytania dotyczące pliku microsoft.cdn

[Microsoft CDN (wersja klasyczna)] Żądania na godzinę

Renderuj wykres liniowy przedstawiający łączną liczbę żądań na godzinę.

// Summarize number of requests per hour 
// Change bins resolution from 1hr to 5m to get real time results)
// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics 
| where OperationName == "Microsoft.Cdn/Profiles/AccessLog/Write" and Category == "AzureCdnAccessLog" 
| where isReceivedFromClient_b == "true"
| summarize RequestCount = count() by bin(TimeGenerated, 1h), Resource, _ResourceId
| render timechart

[Microsoft CDN (wersja klasyczna)] Ruch według adresu URL

Pokaż ruch wychodzący z sieci CDN edge według adresu URL.

// Change bins resolution from 1 hour to 5 minutes to get real time results)
// CDN edge response traffic by URL
AzureDiagnostics
| where OperationName == "Microsoft.Cdn/Profiles/AccessLog/Write" and Category == "AzureCdnAccessLog" 
| where isReceivedFromClient_b == true
| summarize ResponseBytes = sum(toint(responseBytes_s)) by requestUri_s

[Microsoft CDN (wersja klasyczna)] Współczynnik błędów 4XX według adresu URL

Pokaż współczynnik błędów 4XX według adresu URL.

// Request errors rate by URL
// Count number of requests with error responses by URL. 
// Summarize number of requests by URL, and status codes are 4XX
// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where OperationName == "Microsoft.Cdn/Profiles/AccessLog/Write" and Category == "AzureCdnAccessLog" and isReceivedFromClient_b == true
| extend Is4XX = (toint(httpStatusCode_s ) >= 400 and toint(httpStatusCode_s ) < 500)
| summarize 4xxrate = (1.0 * countif(Is4XX)  / count()) * 100 by requestUri_s, bin(TimeGenerated, 1h), _ResourceId

[Microsoft CDN (wersja klasyczna)] Błędy żądań według agenta użytkownika

Liczba żądań z odpowiedziami na błędy według agenta użytkownika.

// Summarize number of requests per user agent and status codes >= 400
// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where OperationName == "Microsoft.Cdn/Profiles/AccessLog/Write" and Category == "AzureCdnAccessLog" 
| where isReceivedFromClient_b == true
| where toint(httpStatusCode_s) >= 400
| summarize RequestCount = count() by UserAgent = userAgent_s, StatusCode = httpStatusCode_s , Resource, _ResourceId
| order by RequestCount desc

[Microsoft CDN (wersja klasyczna)] 10 pierwszych żądań adresu URL

Pokaż 10 pierwszych adresów URL według liczby żądań.

// top URLs by request count
// Render line chart showing total requests per hour . 
// Summarize number of requests per hour 
AzureDiagnostics
| where OperationName == "Microsoft.Cdn/Profiles/AccessLog/Write" and Category == "AzureCdnAccessLog" 
| where isReceivedFromClient_b == true
| summarize UserRequestCount = count() by requestUri_s
| order by UserRequestCount
| limit 10

[Microsoft CDN (wersja klasyczna)] Liczba unikatowych żądań IP

Pokaż unikatową liczbę żądań IP.

AzureDiagnostics
| where OperationName == "Microsoft.Cdn/Profiles/AccessLog/Write"and Category == "AzureCdnAccessLog"
| where isReceivedFromClient_b == true
| summarize dcount(clientIp_s) by bin(TimeGenerated, 1h)
| render timechart 

[Microsoft CDN (wersja klasyczna)] 10 najważniejszych adresów IP klienta i wersji PROTOKOŁU HTTP

Pokaż 10 pierwszych adresów IP klienta i wersji http.

// Top 10 client IPs and http versions 
// Show top 10 client IPs and http versions. 
// Summarize top 10 client ips and http versions
AzureDiagnostics
| where OperationName == "Microsoft.Cdn/Profiles/AccessLog/Write" and Category == "AzureCdnAccessLog"
| where isReceivedFromClient_b == true
| summarize RequestCount = count() by ClientIP = clientIp_s, HttpVersion = httpVersion_s, Resource
| top 10 by RequestCount 
| order by RequestCount desc

[Azure Front Door Standard/Premium] 20 zablokowanych klientów według adresu IP i reguły

Pokaż 20 zablokowanych klientów według adresu IP i nazwy reguły.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.CDN" and Category == "FrontDoorWebApplicationFirewallLog"
| where action_s == "Block"
| summarize RequestCount = count() by ClientIP = clientIP_s, UserAgent = userAgent_s, RuleName = ruleName_s,Resource
| top 20 by RequestCount 
| order by RequestCount desc

[Azure Front Door Standard/Premium] Żądania do źródła według trasy

Zlicz liczbę żądań dla każdej trasy i źródła na minutę. Podsumuj liczbę żądań na minutę dla każdej trasy i źródła.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.CDN" and Category == "FrontDoorAccessLog"
| summarize RequestCount = count() by bin(TimeGenerated, 1m), Resource, RouteName = routingRuleName_s, originName = originName_s, ResourceId

[Azure Front Door Standard/Premium] Błędy żądań według agenta użytkownika

Liczba żądań z odpowiedziami na błędy według agenta użytkownika. Podsumuj liczbę żądań na agenta użytkownika i kody >stanu = 400.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.CDN" and Category == "FrontDoorAccessLog"
| where toint(httpStatusCode_s) >= 400
| summarize RequestCount = count() by UserAgent = userAgent_s, StatusCode = httpStatusCode_s , Resource, ResourceId
| order by RequestCount desc

[Azure Front Door Standard/Premium] 10 najważniejszych adresów IP klienta i wersji protokołu HTTP

Pokaż 10 pierwszych adresów IP klienta i wersji http według liczby żądań.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.CDN" and Category == "FrontDoorAccessLog"
| summarize RequestCount = count() by ClientIP = clientIp_s, HttpVersion = httpVersion_s, Resource
|top 10 by RequestCount 
| order by RequestCount desc

[Azure Front Door Standard/Premium] Błędy żądań według hosta i ścieżki

Zlicz liczbę żądań z odpowiedziami o błędach według hosta i ścieżki. Podsumuj liczbę żądań według hostów, ścieżki i kodów >stanu = 400.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.CDN" and Category == "FrontDoorAccessLog"
| where toint(httpStatusCode_s) >= 400
| extend ParsedUrl = parseurl(requestUri_s)
| summarize RequestCount = count() by Host = tostring(ParsedUrl.Host), Path = tostring(ParsedUrl.Path), StatusCode = httpStatusCode_s, ResourceId
| order by RequestCount desc

[Azure Front Door Standard/Premium] Liczba żądań zablokowanych przez zaporę na godzinę

Liczba zablokowanych żądań zapory na godzinę. Podsumuj liczbę zablokowanych żądań zapory na godzinę według zasad.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.CDN" and Category == "FrontDoorWebApplicationFirewallLog"
| where action_s == "Block"
| summarize RequestCount = count() by bin(TimeGenerated, 1h), Policy = policy_s, PolicyMode = policyMode_s, Resource, ResourceId
| order by RequestCount desc

[Azure Front Door Standard/Premium] Liczba żądań zapory według hosta, ścieżki, reguły i akcji

Zlicz żądania przetworzone przez zaporę według hosta, ścieżki, reguły i akcji. Podsumuj liczbę żądań według hosta, ścieżki, reguły i akcji.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.CDN" and Category == "FrontDoorWebApplicationFirewallLog"
| extend ParsedUrl = parseurl(requestUri_s)
| summarize RequestCount = count() by Host = tostring(ParsedUrl.Host), Path = tostring(ParsedUrl.Path), RuleName = ruleName_s, Action = action_s, ResourceId
| order by RequestCount desc

[Azure Front Door Standard/Premium] Żądania na godzinę

Renderuj wykres liniowy przedstawiający łączną liczbę żądań na godzinę dla każdego zasobu FrontDoor.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.CDN" and Category == "FrontDoorWebApplicationFirewallLog"
| summarize RequestCount = count() by bin(TimeGenerated, 1h), Resource, ResourceId
| render timechart 

[Azure Front Door Standard/Premium] 10 pierwszych żądań adresu URL

Pokaż 10 pierwszych adresów URL według liczby żądań.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.CDN" and Category == "FrontDoorAccessLog"
| summarize UserRequestCount = count() by requestUri_s
| order by UserRequestCount
| limit 10

[Azure Front Door Standard/Premium] 10 pierwszych żądań adresu URL

Pokaż ruch wychodzący z urządzenia brzegowego usługi AFD według adresu URL. Zmień rozdzielczość pojemników z 1 godz. na 5 m, aby uzyskać wyniki w czasie rzeczywistym.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.CDN" and Category == "FrontDoorAccessLog"
| summarize ResponseBytes = sum(toint(responseBytes_s)) by requestUri_s

[Azure Front Door Standard/Premium] Liczba unikatowych żądań IP

Pokaż unikatową liczbę żądań IP.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.CDN" and Category == "FrontDoorAccessLog"
| summarize dcount(clientIp_s) by bin(TimeGenerated, 1h)
| render timechart

Zapytania dotyczące pliku microsoft.containerservice

Znajdź w usłudze AzureDiagnostics

Znajdź w usłudze AzureDiagnostics, aby wyszukać określoną wartość w tabeli AzureDiagnostics./nNote, że to zapytanie wymaga zaktualizowania parametru <SeachValue> w celu wygenerowania wyników

// This query requires a parameter to run. Enter value in SearchValue to find in table.
let SearchValue =  "<SearchValue>";//Please update term you would like to find in the table.
AzureDiagnostics
| where ResourceProvider == "Microsoft.ContainerService"
| where * contains tostring(SearchValue)
| take 1000

Zapytania dotyczące bazy danych microsoft.dbformariadb

Czas wykonywania przekraczający próg

Zidentyfikuj zapytania, których czas wykonywania przekracza 10 sekund.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider =="MICROSOFT.DBFORMARIADB" 
| where Category == 'MySqlSlowLogs'
| project TimeGenerated, LogicalServerName_s, event_class_s, start_time_t , query_time_d, sql_text_s, ResourceId 
| where query_time_d > 10 // You may change the time threshold

Pokaż najwolniejsze zapytania

Zidentyfikuj 5 najwolniejszych zapytań.

AzureDiagnostics
| where ResourceProvider =="MICROSOFT.DBFORMARIADB" 
| where Category == 'MySqlSlowLogs'
| project TimeGenerated, LogicalServerName_s, event_class_s, start_time_t , query_time_d, sql_text_s 
| top 5 by query_time_d desc

Pokaż statystyki zapytania

Konstruowanie tabeli statystyk podsumowania według zapytania.

AzureDiagnostics
| where ResourceProvider =="MICROSOFT.DBFORMARIADB" 
| where Category == 'MySqlSlowLogs'
| project TimeGenerated, LogicalServerName_s, event_class_s, start_time_t , query_time_d, sql_text_s 
| summarize count(), min(query_time_d), max(query_time_d), avg(query_time_d), stdev(query_time_d), percentile(query_time_d, 95) by LogicalServerName_s ,sql_text_s 
|  top 50  by percentile_query_time_d_95 desc

Przeglądanie zdarzeń dziennika inspekcji w klasie GENERAL

Zidentyfikuj ogólne zdarzenia klasy dla serwera.

AzureDiagnostics
| where ResourceProvider =="MICROSOFT.DBFORMARIADB" 
| where Category == 'MySqlAuditLogs' and event_class_s == "general_log"
| project TimeGenerated, LogicalServerName_s, event_class_s, event_subclass_s, event_time_t, user_s , ip_s , sql_text_s 
| order by TimeGenerated asc

Przeglądanie zdarzeń dziennika inspekcji w klasie CONNECTION

Zidentyfikuj zdarzenia związane z połączeniem dla serwera.

AzureDiagnostics
| where ResourceProvider =="MICROSOFT.DBFORMARIADB" 
| where Category == 'MySqlAuditLogs' and event_class_s == "connection_log"
| project TimeGenerated, LogicalServerName_s, event_class_s, event_subclass_s, event_time_t, user_s , ip_s , sql_text_s 
| order by TimeGenerated asc 

Zapytania dotyczące bazy danych microsoft.dbformysql

Czas wykonywania przekraczający próg

Zidentyfikuj zapytania, których czas wykonywania przekracza 10 sekund.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DBFORMYSQL"
| where Category == 'MySqlSlowLogs'
| project TimeGenerated, LogicalServerName_s, event_class_s, start_time_t , query_time_d, sql_text_s, ResourceId 
| where query_time_d > 10 //You may change the time threshold 

Pokaż najwolniejsze zapytania

Zidentyfikuj 5 najwolniejszych zapytań.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DBFORMYSQL" 
| where Category == 'MySqlSlowLogs'
| project TimeGenerated, LogicalServerName_s, event_class_s, start_time_t , query_time_d, sql_text_s 
| top 5 by query_time_d desc

Pokaż statystyki zapytania

Konstruowanie tabeli statystyk podsumowania według zapytania.

AzureDiagnostics
| where ResourceProvider ==  "MICROSOFT.DBFORMYSQL"
| where Category == 'MySqlSlowLogs'
| project TimeGenerated, LogicalServerName_s, event_class_s, start_time_t , query_time_d, sql_text_s 
| summarize count(), min(query_time_d), max(query_time_d), avg(query_time_d), stdev(query_time_d), percentile(query_time_d, 95) by LogicalServerName_s ,sql_text_s 
|  top 50  by percentile_query_time_d_95 desc

Przeglądanie zdarzeń dziennika inspekcji w klasie GENERAL

Zidentyfikuj ogólne zdarzenia klasy dla serwera.

AzureDiagnostics
| where ResourceProvider =="MICROSOFT.DBFORMYSQL"
| where Category == 'MySqlAuditLogs' and event_class_s == "general_log"
| project TimeGenerated, LogicalServerName_s, event_class_s, event_subclass_s, event_time_t, user_s , ip_s , sql_text_s 
| order by TimeGenerated asc

Przeglądanie zdarzeń dziennika inspekcji w klasie CONNECTION

Zidentyfikuj zdarzenia związane z połączeniem dla serwera.

AzureDiagnostics
| where ResourceProvider =="MICROSOFT.DBFORMYSQL"
| where Category == 'MySqlAuditLogs' and event_class_s == "connection_log"
| project TimeGenerated, LogicalServerName_s, event_class_s, event_subclass_s, event_time_t, user_s , ip_s , sql_text_s 
| order by TimeGenerated asc 

Zapytania dotyczące bazy danych microsoft.dbforpostgresql

Zdarzenia automatycznego czyszczenia

Wyszukaj zdarzenia automatycznego czyszczenia w ciągu ostatnich 24 godzin. Wymaga włączonego parametru "log_autovacuum_min_duration".

AzureDiagnostics
| where TimeGenerated > ago(1d) 
| where ResourceProvider =="MICROSOFT.DBFORPOSTGRESQL" 
| where Category == "PostgreSQLLogs"
| where Message contains "automatic vacuum"

Ponowne uruchomienia serwera

Wyszukaj zdarzenia zamykania serwera i gotowe do serwera.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where TimeGenerated > ago(7d)
| where ResourceProvider =="MICROSOFT.DBFORPOSTGRESQL" 
| where Category == "PostgreSQLLogs"
| where Message contains "database system was shut down at" or Message contains "database system is ready to accept" 

Znajdowanie błędów

Wyszukaj błędy w ciągu ostatnich 6 godzin.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where TimeGenerated > ago(6h)
| where Category == "PostgreSQLLogs"
| where  errorLevel_s contains "error" 

Nieautoryzowane połączenia

Wyszukaj nieautoryzowane (odrzucone) próby połączenia.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider =="MICROSOFT.DBFORPOSTGRESQL" 
| where Category == "PostgreSQLLogs"
| where Message contains "password authentication failed" or Message contains "no pg_hba.conf entry for host"

Zakleszczenia

Wyszukaj zdarzenia zakleszczenia.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider =="MICROSOFT.DBFORPOSTGRESQL" 
| where Category == "PostgreSQLLogs"
| where Message contains "deadlock detected"

Rywalizacja blokad

Wyszukaj rywalizację o blokadę. Wymaga log_lock_waits=ON i zależy od ustawienia deadlock_timeout.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider =="MICROSOFT.DBFORPOSTGRESQL" 
| where Message contains "still waiting for ShareLock on transaction" 

Dzienniki inspekcji

Pobierz wszystkie dzienniki inspekcji. Wymaga to włączenia dzienników inspekcji [https://docs.microsoft.com/azure/postgresql/concepts-audit].

AzureDiagnostics
| where ResourceProvider =="MICROSOFT.DBFORPOSTGRESQL" 
| where Category == "PostgreSQLLogs"
| where Message contains "AUDIT:"

Dzienniki inspekcji dla tabel i typów zdarzeń

Wyszukaj dzienniki inspekcji dla określonej tabeli i typu zdarzenia DDL. Inne typy zdarzeń to READ, WRITE, FUNCTION, MISC. Wymaga to włączenia dzienników inspekcji. [https://docs.microsoft.com/azure/postgresql/concepts-audit].

AzureDiagnostics
| where ResourceProvider =="MICROSOFT.DBFORPOSTGRESQL" 
| where Category == "PostgreSQLLogs"
| where Message contains "AUDIT:" 
| where Message contains "table name" and Message contains "DDL"

Zapytania z czasem wykonywania przekraczającym próg

Zidentyfikuj zapytania, które zajmują więcej niż 10 sekund. Magazyn zapytań normalizuje rzeczywiste zapytania w celu agregowania podobnych zapytań. Domyślnie wpisy są agregowane co 15 minut. Zapytanie wykorzystuje średni czas wykonywania co 15 minut i inne statystyki zapytań, takie jak maksymalna, minimalna wartość minimalna może być używana zgodnie z potrzebami.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DBFORPOSTGRESQL"
| where Category == "QueryStoreRuntimeStatistics"
| where user_id_s != "10" //exclude azure system user
| project TimeGenerated, LogicalServerName_s, event_type_s , mean_time_s , db_id_s , start_time_s , query_id_s, _ResourceId
| where todouble(mean_time_s) > 0 // You may change the time threshold

Najwolniejsze zapytania

Zidentyfikuj 5 najwolniejszych zapytań.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DBFORPOSTGRESQL"
| where Category == "QueryStoreRuntimeStatistics"
| where user_id_s != "10" //exclude azure system user
| summarize avg(todouble(mean_time_s)) by event_class_s , db_id_s ,query_id_s
| top 5 by avg_mean_time_s desc

Statystyki zapytań

Konstruowanie tabeli statystyk podsumowania według zapytania.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DBFORPOSTGRESQL"
| where Category == "QueryStoreRuntimeStatistics"
| where user_id_s != "10" //exclude azure system user
| summarize sum(toint(calls_s)), min(todouble(min_time_s)),max(todouble(max_time_s)),avg(todouble(mean_time_s)),percentile(todouble(mean_time_s),95) by  db_id_s ,query_id_s
| order by percentile_mean_time_s_95 desc nulls last 

Trend wykonywania według zapytania zagregowanego przez 15-minutowe interwały.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DBFORPOSTGRESQL"
| where Category == "QueryStoreRuntimeStatistics"
| where user_id_s != "10" //exclude azure system user
| summarize sum(toint(calls_s)) by  tostring(query_id_s), bin(TimeGenerated, 15m), ResourceId
| render timechart 

Najważniejsze zdarzenia oczekiwania

Zidentyfikuj 5 najważniejszych zdarzeń oczekiwania według zapytań.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DBFORPOSTGRESQL"
| where Category == "QueryStoreWaitStatistics"
| where user_id_s != "10" //exclude azure system user
| where query_id_s != 0
| summarize sum(toint(calls_s)) by event_s, query_id_s, bin(TimeGenerated, 15m)
| top 5 by sum_calls_s desc nulls last

Wyświetlanie trendów zdarzeń oczekiwania w czasie.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DBFORPOSTGRESQL"
| where Category == "QueryStoreWaitStatistics"
| where user_id_s != "10" //exclude azure system user
| extend query_id_s = tostring(query_id_s)
| summarize sum(toint(calls_s)) by event_s, query_id_s, bin(TimeGenerated, 15m), ResourceId // You may change the time threshold 
| render timechart

Zapytania dotyczące microsoft.devices

Błędy łączności

Zidentyfikuj błędy połączenia urządzenia.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DEVICES" and ResourceType == "IOTHUBS"
| where Category == "Connections" and Level == "Error"

Urządzenia z największymi błędami ograniczania przepustowości

Zidentyfikuj urządzenia, które najwięcej żądań powodowały błędy ograniczania przepustowości.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DEVICES" and ResourceType == "IOTHUBS"
| where ResultType == "429001"
| extend DeviceId = tostring(parse_json(properties_s).deviceId)
| summarize count() by DeviceId, Category , _ResourceId
| order by count_ desc

Nieaktywne punkty końcowe

Zidentyfikuj punkty końcowe nieaktywne lub w złej kondycji według liczby zgłoszonych problemów, a także przyczyny.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DEVICES" and ResourceType == "IOTHUBS"
| where Category == "Routes" and OperationName in ("endpointDead", "endpointUnhealthy")
| extend parsed_json = parse_json(properties_s)
| extend Endpoint   = tostring(parsed_json.endpointName), Reason =tostring(parsed_json.details) 
| summarize count() by Endpoint, OperationName, Reason, _ResourceId
| order by count_ desc

Podsumowanie błędu

Liczba błędów we wszystkich operacjach według typu.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DEVICES" and ResourceType == "IOTHUBS"
| where Level == "Error"
| summarize count() by ResultType, ResultDescription, Category, _ResourceId

Ostatnio połączone urządzenia

Lista urządzeń, które IoT Hub połączenia w określonym przedziale czasu.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DEVICES" and ResourceType == "IOTHUBS"
| where Category == "Connections" and OperationName == "deviceConnect"
| extend DeviceId = tostring(parse_json(properties_s).deviceId)
| summarize max(TimeGenerated) by DeviceId, _ResourceId

Wersja zestawu SDK urządzeń

Lista urządzeń i ich wersji zestawu SDK.

// this query works on device connection or when your device uses device to cloud twin operations
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DEVICES" and ResourceType == "IOTHUBS"
| where Category == "Connections" or  Category == "D2CTwinOperations"
| extend parsed_json = parse_json(properties_s) 
| extend SDKVersion = tostring(parsed_json.sdkVersion) , DeviceId = tostring(parsed_json.deviceId)
| distinct DeviceId, SDKVersion, TimeGenerated, _ResourceId

Zapytania dotyczące bazy danych microsoft.documentdb

Użycie jednostek RU/s w ciągu ostatnich 24 godzin

Zidentyfikuj zużyte jednostki RU/s w bazach danych i kolekcjach usługi Cosmos.

// To create an alert for this query, click '+ New alert rule'
//You can compare the RU/s consumption with your provisioned RU/s to determine if you should scale up or down RU/s based on your workload.
AzureDiagnostics
| where TimeGenerated >= ago(24hr)
| where Category == "DataPlaneRequests"
//| where collectionName_s == "CollectionToAnalyze" //Replace to target the query to a collection
| summarize ConsumedRUsPerMinute = sum(todouble(requestCharge_s)) by collectionName_s, _ResourceId, bin(TimeGenerated, 1m)
| project TimeGenerated , ConsumedRUsPerMinute , collectionName_s, _ResourceId
| render timechart

Kolekcje z łańcami (429) w ciągu ostatnich 24 godzin

Zidentyfikuj kolekcje i operacje, które otrzymały 429 (ograniczenia przepustowości), które występują, gdy zużywana przepływność (RU/s) przekracza aprowizowaną przepływność.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where TimeGenerated >= ago(24hr)
| where Category == "DataPlaneRequests"
| where statusCode_s == 429 
| summarize numberOfThrottles = count() by databaseName_s, collectionName_s, requestResourceType_s, _ResourceId, bin(TimeGenerated, 1hr)
| order by numberOfThrottles

Najważniejsze operacje wykonywane przez zużyte jednostki żądań (RU) w ciągu ostatnich 24 godzin

Zidentyfikuj najważniejsze operacje na zasobach usługi Cosmos według liczby i wykorzystanych jednostek RU na operację.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where TimeGenerated >= ago(24h)
| where Category == "DataPlaneRequests"
| summarize numberOfOperations = count(), totalConsumedRU = sum(todouble(requestCharge_s)) by databaseName_s, collectionName_s, OperationName, requestResourceType_s, requestResourceId_s, _ResourceId
| extend averageRUPerOperation = totalConsumedRU / numberOfOperations 
| order by numberOfOperations

Najważniejsze klucze partycji logicznej według magazynu

Zidentyfikuj największe wartości klucza partycji logicznej. PartitionKeyStatistics emituje dane dla najważniejszych kluczy partycji logicznych według magazynu.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where Category == "PartitionKeyStatistics"
//| where collectionName_s == "CollectionToAnalyze" //Replace to target the query to a collection
| summarize arg_max(TimeGenerated, *) by databaseName_s, collectionName_s, partitionKey_s, _ResourceId //Get the latest storage size
| extend utilizationOf20GBLogicalPartition = sizeKb_d / 20000000 //20GB
| project TimeGenerated, databaseName_s , collectionName_s , partitionKey_s, sizeKb_d, utilizationOf20GBLogicalPartition, _ResourceId

Zapytania dotyczące witryny microsoft.eventhub

[Klasyczny] Czas trwania niepowodzenia przechwytywania

Zawiera podsumowanie duaracji błędu podczas przechwytywania.

AzureDiagnostics
| where ResourceProvider == \"MICROSOFT.EVENTHUB\"
| where Category == \"ArchiveLogs\"
| summarize count() by \"failures\", \"durationInSeconds\", _ResourceId

[Klasyczny] Żądanie dołączenia do klienta

Podsumowano stan żądania dołączenia dla klienta.

AzureDiagnostics // Need to turn on the Capture for this 
| where ResourceProvider == \"MICROSOFT.EVENTHUB\"
|  project \"OperationName\"

[Klasyczny] Dostęp do magazynu kluczy — nie znaleziono klucza

Podsumowuje dostęp do magazynu kluczy, gdy nie można odnaleźć klucza.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == \"MICROSOFT.EVENTHUB\"
| where Category == \"Error\" and OperationName == \"wrapkey\"
| project Message, _ResourceId

[Klasyczny] Operacja wykonywana za pomocą magazynu kluczy

Podsumowuje operację wykonaną za pomocą magazynu kluczy w celu wyłączenia lub przywrócenia klucza.

AzureDiagnostics
| where ResourceProvider == \"MICROSOFT.EVENTHUB\"
| where Category == \"info\" and OperationName == \"disable\" or OperationName == \"restore\"
| project Message

Błędy w ciągu ostatnich 7 dni

Spowoduje to wyświetlenie listy wszystkich błędów z ostatnich 7 dni.

AzureDiagnostics
| where TimeGenerated > ago(7d)
| where ResourceProvider =="MICROSOFT.EVENTHUB"
| where Category == "OperationalLogs"
| summarize count() by "EventName", _ResourceId

Czas trwania niepowodzenia przechwytywania

Zawiera podsumowanie duaracji błędu podczas przechwytywania.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.EVENTHUB"
| where Category == "ArchiveLogs"
| summarize count() by "failures", "durationInSeconds", _ResourceId

Żądanie dołączenia do klienta

Podsumowano stan żądania dołączenia dla klienta.

AzureDiagnostics // Need to turn on the Capture for this 
| where ResourceProvider == "MICROSOFT.EVENTHUB"
|  project "OperationName"

Dostęp do magazynu kluczy — nie znaleziono klucza

Podsumowuje dostęp do magazynu kluczy, gdy nie można odnaleźć klucza.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.EVENTHUB" 
| where Category == "Error" and OperationName == "wrapkey"
| project Message, ResourceId

Operacja wykonywana za pomocą magazynu kluczy

Podsumowuje operację wykonaną za pomocą magazynu kluczy w celu wyłączenia lub przywrócenia klucza.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.EVENTHUB"
| where Category == "info" and OperationName == "disable" or OperationName == "restore"
| project Message

Zapytania dotyczące usługi microsoft.keyvault

[Klasyczny] Jak aktywny jest ten magazyn Kluczy?

[Klasyczny] Wykres liniowy przedstawiający trend liczby żądań usługi KeyVault na operację w czasie.

// KeyVault diagnostic currently stores logs in AzureDiagnostics table which stores logs for multiple services. 
// Filter on ResourceProvider for logs specific to a service.
AzureDiagnostics
| where ResourceProvider =="MICROSOFT.KEYVAULT" 
| summarize count() by bin(TimeGenerated, 1h), OperationName // Aggregate by hour
| render timechart

[Klasyczny] Kto wywołuje tę usługę KeyVault?

[Klasyczny] Lista rozmówców zidentyfikowanych przez ich adres IP z liczbą żądań.

// KeyVault diagnostic currently stores logs in AzureDiagnostics table which stores logs for multiple services. 
// Filter on ResourceProvider for logs specific to a service.
AzureDiagnostics
| where ResourceProvider =="MICROSOFT.KEYVAULT"
| summarize count() by CallerIPAddress

[Klasyczny] Czy są jakieś powolne żądania?

[Klasyczny] Lista żądań usługi KeyVault, które trwały dłużej niż 1 s.

// To create an alert for this query, click '+ New alert rule'
let threshold=1000; // let operator defines a constant that can be further used in the query
AzureDiagnostics
| where ResourceProvider =="MICROSOFT.KEYVAULT" 
| where DurationMs > threshold
| summarize count() by OperationName, _ResourceId

[Klasyczny] Jak szybko usługa KeyVault obsługuje żądania?

[Klasyczny] Wykres liniowy przedstawiający trend czasu trwania żądania w czasie przy użyciu różnych agregacji.

AzureDiagnostics
| where ResourceProvider =="MICROSOFT.KEYVAULT" 
| summarize avg(DurationMs) by requestUri_s, bin(TimeGenerated, 1h) // requestUri_s contains the URI of the request
| render timechart

[Klasyczny] Czy występują jakieś błędy?

[Klasyczny] Liczba nieudanych żądań usługi KeyVault według kodu stanu.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider =="MICROSOFT.KEYVAULT" 
| where httpStatusCode_d >= 300 and not(OperationName == "Authentication" and httpStatusCode_d == 401)
| summarize count() by requestUri_s, ResultSignature, _ResourceId
// ResultSignature contains HTTP status, e.g. "OK" or "Forbidden"
// httpStatusCode_d contains HTTP status code returned by the request (e.g.  200, 300 or 401)
// requestUri_s contains the URI of the request

[Klasyczny] Jakie zmiany wystąpiły w zeszłym miesiącu?

[Klasyczny] Listy wszystkie żądania aktualizacji i poprawek z ostatnich 30 dni.

// KeyVault diagnostic currently stores logs in AzureDiagnostics table which stores logs for multiple services. 
// Filter on ResourceProvider for logs specific to a service.
AzureDiagnostics
| where TimeGenerated > ago(30d) // Time range specified in the query. Overrides time picker in portal.
| where ResourceProvider =="MICROSOFT.KEYVAULT" 
| where OperationName == "VaultPut" or OperationName == "VaultPatch"
| sort by TimeGenerated desc

[Klasyczny] Wyświetlanie listy wszystkich błędów deserializacji danych wejściowych

[Klasyczny] Pokazuje błędy spowodowane przez źle sformułowane zdarzenia, których nie można zdeserializować przez zadanie.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.KEYVAULT" and parse_json(properties_s).DataErrorType in ("InputDeserializerError.InvalidData", "InputDeserializerError.TypeConversionError", "InputDeserializerError.MissingColumns", "InputDeserializerError.InvalidHeader", "InputDeserializerError.InvalidCompressionType")
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

[Klasyczny] Znajdź w usłudze AzureDiagnostics

[Klasyczny] Znajdź w usłudze AzureDiagnostics, aby wyszukać określoną wartość w tabeli AzureDiagnostics./nNote, że to zapytanie wymaga zaktualizowania parametru <SeachValue> w celu wygenerowania wyników

// This query requires a parameter to run. Enter value in SearchValue to find in table.
let SearchValue =  "<SearchValue>";//Please update term you would like to find in the table.
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.KEYVAULT"
| where * contains tostring(SearchValue)
| take 1000

Zapytania dotyczące pliku microsoft.logic

Łączna liczba rozliczanych wykonań

Łączna liczba rozliczanych wykonań według nazwy operacji.

// Total billable executions
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.LOGIC"
| where Category == "WorkflowRuntime" 
| where OperationName has "workflowTriggerStarted" or OperationName has "workflowActionStarted" 
| summarize dcount(resource_runId_s) by OperationName, resource_workflowName_s

Dystrybucja wykonywania aplikacji logiki według przepływów pracy

Schemat godzinowy wykonywania aplikacji logiki, dystrybucja według przepływów pracy.

// Hourly Time chart for Logic App execution distribution by workflows
AzureDiagnostics 
| where ResourceProvider == "MICROSOFT.LOGIC"
| where Category == "WorkflowRuntime"
| where OperationName has "workflowRunStarted"
| summarize dcount(resource_runId_s) by bin(TimeGenerated, 1h), resource_workflowName_s
| render timechart 

Dystrybucja wykonywania aplikacji logiki według stanu

Ukończono wykonywanie według przepływu pracy, stanu i błędu.

//logic app execution status summary
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.LOGIC"
| where OperationName has "workflowRunCompleted"
| summarize dcount(resource_runId_s) by resource_workflowName_s, status_s, error_code_s
| project LogicAppName = resource_workflowName_s , NumberOfExecutions = dcount_resource_runId_s , RunStatus = status_s , Error = error_code_s 

Liczba wyzwolonych niepowodzeń

Pokaż błędy akcji/wyzwalacza dla wszystkich wykonań aplikacji logiki według nazwy zasobu.

// To create an alert for this query, click '+ New alert rule'
//Action/Trigger failures for all Logic App executions
AzureDiagnostics
| where ResourceProvider  == "MICROSOFT.LOGIC"  
| where Category == "WorkflowRuntime" 
| where status_s == "Failed" 
| where OperationName has "workflowActionCompleted" or OperationName has "workflowTriggerCompleted" 
| extend ResourceName = coalesce(resource_actionName_s, resource_triggerName_s) 
| extend ResourceCategory = substring(OperationName, 34, strlen(OperationName) - 43) | summarize dcount(resource_runId_s) by code_s, ResourceName, resource_workflowName_s, ResourceCategory, _ResourceId
| project ResourceCategory, ResourceName , FailureCount = dcount_resource_runId_s , ErrorCode = code_s, LogicAppName = resource_workflowName_s, _ResourceId 
| order by FailureCount desc 

Zapytania dotyczące usługi microsoft.network

Żądania na godzinę

Liczba żądań przychodzących w Application Gateway.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceType == "APPLICATIONGATEWAYS" and OperationName == "ApplicationGatewayAccess"
| summarize AggregatedValue = count() by bin(TimeGenerated, 1h), _ResourceId
| render timechart

Żądania inne niż SSL na godzinę

Liczba żądań innych niż SSL na Application Gateway.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceType == "APPLICATIONGATEWAYS" and OperationName == "ApplicationGatewayAccess" and sslEnabled_s == "off"
| summarize AggregatedValue = count() by bin(TimeGenerated, 1h), _ResourceId
| render timechart

Żądania nieudane na godzinę

Liczba żądań, do których Application Gateway odpowiedziała z powodu błędu.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceType == "APPLICATIONGATEWAYS" and OperationName == "ApplicationGatewayAccess" and httpStatus_d > 399
| summarize AggregatedValue = count() by bin(TimeGenerated, 1h), _ResourceId
| render timechart

Błędy według agenta użytkownika

Liczba błędów według agenta użytkownika.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceType == "APPLICATIONGATEWAYS" and OperationName == "ApplicationGatewayAccess" and httpStatus_d > 399
| summarize AggregatedValue = count() by userAgent_s, _ResourceId
| sort by AggregatedValue desc

Błędy według identyfikatora URI

Liczba błędów według identyfikatora URI.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceType == "APPLICATIONGATEWAYS" and OperationName == "ApplicationGatewayAccess" and httpStatus_d > 399
| summarize AggregatedValue = count() by requestUri_s, _ResourceId
| sort by AggregatedValue desc

10 pierwszych adresów IP klientów

Liczba żądań na adres IP klienta.

AzureDiagnostics
| where ResourceType == "APPLICATIONGATEWAYS" and OperationName == "ApplicationGatewayAccess"
| summarize AggregatedValue = count() by clientIP_s
| top 10 by AggregatedValue

Najważniejsze wersje protokołu HTTP

Liczba żądań na wersję PROTOKOŁU HTTP.

AzureDiagnostics
| where ResourceType == "APPLICATIONGATEWAYS" and OperationName == "ApplicationGatewayAccess"
| summarize AggregatedValue = count() by httpVersion_s
| top 10 by AggregatedValue

Zdarzenia zabezpieczeń sieci

Znajdź sieciowe zdarzenia zabezpieczeń raportowania zablokowanego ruchu przychodzącego.

AzureDiagnostics 
| where ResourceProvider == "MICROSOFT.NETWORK"  
| where Category == "NetworkSecurityGroupEvent"  
| where direction_s == "In" and type_s == "block"

Żądania na godzinę

Renderuj wykres liniowy przedstawiający łączną liczbę żądań na godzinę dla każdego zasobu FrontDoor.

// Summarize number of requests per hour for each FrontDoor resource
// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics 
| where ResourceProvider == "MICROSOFT.NETWORK" and Category == "FrontdoorAccessLog"
| summarize RequestCount = count() by bin(TimeGenerated, 1h), Resource, ResourceId
| render timechart 

Żądania zaplecza przekazywane przez regułę routingu

Zlicz liczbę żądań dla każdej reguły routingu i hosta zaplecza na minutę.

// Summarize number of requests per minute for each routing rule and backend host
// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics 
| where ResourceProvider == "MICROSOFT.NETWORK" and Category == "FrontdoorAccessLog"
| summarize RequestCount = count() by bin(TimeGenerated, 1m), Resource, RoutingRuleName = routingRuleName_s, BackendHostname = backendHostname_s, ResourceId

Błędy żądania według hosta i ścieżki

Zlicz liczbę żądań z odpowiedziami o błędach według hosta i ścieżki.

// Summarize number of requests by host, path, and status codes >= 400
// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.NETWORK" and Category == "FrontdoorAccessLog"
| where toint(httpStatusCode_s) >= 400
| extend ParsedUrl = parseurl(requestUri_s)
| summarize RequestCount = count() by Host = tostring(ParsedUrl.Host), Path = tostring(ParsedUrl.Path), StatusCode = httpStatusCode_s, ResourceId
| order by RequestCount desc 

Żądanie błędów przez agenta użytkownika

Zlicz liczbę żądań z odpowiedziami na błędy przez agenta użytkownika.

// Summarize number of requests per user agent and status codes >= 400
// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.NETWORK" and Category == "FrontdoorAccessLog"
| where toint(httpStatusCode_s) >= 400
| summarize RequestCount = count() by UserAgent = userAgent_s, StatusCode = httpStatusCode_s , Resource, ResourceId
| order by RequestCount desc 

10 pierwszych adresów IP klientów i wersji http

Pokaż 10 pierwszych adresów IP klienta i wersji http.

// Summarize top 10 client ips and http versions
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.NETWORK" and Category == "FrontdoorAccessLog"
| summarize RequestCount = count() by ClientIP = clientIp_s, HttpVersion = httpVersion_s, Resource
| top 10 by RequestCount 
| order by RequestCount desc

Liczba zablokowanych żądań zapory na godzinę

Liczba zablokowanych żądań zapory na godzinę.

// Summarize number of firewall blocked requests per hour by policy
// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.NETWORK" and Category == "FrontdoorWebApplicationFirewallLog"
| where action_s == "Block"
| summarize RequestCount = count() by bin(TimeGenerated, 1h), Policy = policy_s, PolicyMode = policyMode_s, Resource, ResourceId
| order by RequestCount desc

20 pierwszych zablokowanych klientów według adresu IP i reguły

Pokaż 20 zablokowanych klientów według adresu IP i nazwy reguły.

// Summarize top 20 blocked clients by IP and rule
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.NETWORK" and Category == "FrontdoorWebApplicationFirewallLog"
| where action_s == "Block"
| summarize RequestCount = count() by ClientIP = clientIP_s, UserAgent = userAgent_s, RuleName = ruleName_s ,Resource
| top 20 by RequestCount 
| order by RequestCount desc

Liczba żądań zapory według hosta, ścieżki, reguły i akcji

Zlicz żądania przetworzone przez zaporę według hosta, ścieżki, reguły i akcji podjętej.

// Summarize request count by host, path, rule, and action
// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.NETWORK" and Category == "FrontdoorWebApplicationFirewallLog"
| extend ParsedUrl = parseurl(requestUri_s)
| summarize RequestCount = count() by Host = tostring(ParsedUrl.Host), Path = tostring(ParsedUrl.Path), RuleName = ruleName_s, Action = action_s, ResourceId
| order by RequestCount desc

Dane dziennika reguł aplikacji

Analizuje dane dziennika reguł aplikacji.

AzureDiagnostics
| where Category == "AzureFirewallApplicationRule"
//this first parse statement is valid for all entries as they all start with this format
| parse msg_s with Protocol " request from " SourceIP ":" SourcePort:int * 
//Parse action as this is the same for all log lines 
| parse kind=regex flags=U msg_s with * ". Action\\: " Action "\\."
// case1: Action: A. Reason: R.
| parse kind=regex flags=U msg_s with "\\. Reason\\: " Reason "\\."
//case 2a: to FQDN:PORT Url: U. Action: A. Policy: P. Rule Collection Group: RCG. Rule Collection: RC. Rule: R.
| parse msg_s with * "to " FQDN ":" TargetPort:int * "." *
//Parse policy if present
| parse msg_s with * ". Policy: " Policy ". Rule Collection Group: " RuleCollectionGroup "." *
| parse msg_s with * " Rule Collection: " RuleCollection ". Rule: " Rule
//case 2.b: Web Category: WC.
| parse Rule with * ". Web Category: " WebCategory
//case 3: No rule matched. Proceeding with default action"
| extend DefaultRule = iff(msg_s contains "No rule matched. Proceeding with default action", true, false)
| extend 
SourcePort = tostring(SourcePort),
TargetPort = tostring(TargetPort)
| extend 
 Action = case(Action == "","N/A", case(DefaultRule, "Deny" ,Action)),
 FQDN = case(FQDN == "", "N/A", FQDN),
 TargetPort = case(TargetPort == "", "N/A", tostring(TargetPort)),
 Policy = case(RuleCollection contains ":", split(RuleCollection, ":")[0] ,case(Policy == "", "N/A", Policy)),
 RuleCollectionGroup = case(RuleCollection contains ":", split(RuleCollection, ":")[1], case(RuleCollectionGroup == "", "N/A", RuleCollectionGroup)),
 RuleCollection = case(RuleCollection contains ":", split(RuleCollection, ":")[2], case(RuleCollection == "", "N/A", RuleCollection)),
 WebCategory = case(WebCategory == "", "N/A", WebCategory),
 Rule = case(Rule == "" , "N/A", case(WebCategory == "N/A", Rule, split(Rule, '.')[0])),
 Reason = case(Reason == "", case(DefaultRule, "No rule matched - default action", "N/A"), Reason )
| project TimeGenerated, msg_s, Protocol, SourceIP, SourcePort, FQDN, TargetPort, Action, Policy, RuleCollectionGroup, RuleCollection, Rule, Reason ,WebCategory

Dane dziennika reguł sieciowych

Analizuje dane dziennika reguł sieciowych.

AzureDiagnostics
| where Category == "AzureFirewallNetworkRule"
| where OperationName == "AzureFirewallNatRuleLog" or OperationName == "AzureFirewallNetworkRuleLog"
//case 1: for records that look like this:
//PROTO request from IP:PORT to IP:PORT.
| parse msg_s with Protocol " request from " SourceIP ":" SourcePortInt:int " to " TargetIP ":" TargetPortInt:int *
//case 1a: for regular network rules
| parse kind=regex flags=U msg_s with * ". Action\\: " Action1a "\\."
//case 1b: for NAT rules
//TCP request from IP:PORT to IP:PORT was DNAT'ed to IP:PORT
| parse msg_s with * " was " Action1b:string " to " TranslatedDestination:string ":" TranslatedPort:int *
//Parse rule data if present
| parse msg_s with * ". Policy: " Policy ". Rule Collection Group: " RuleCollectionGroup "." *
| parse msg_s with * " Rule Collection: "  RuleCollection ". Rule: " Rule 
//case 2: for ICMP records
//ICMP request from 10.0.2.4 to 10.0.3.4. Action: Allow
| parse msg_s with Protocol2 " request from " SourceIP2 " to " TargetIP2 ". Action: " Action2
| extend
SourcePort = tostring(SourcePortInt),
TargetPort = tostring(TargetPortInt)
| extend 
    Action = case(Action1a == "", case(Action1b == "",Action2,Action1b), split(Action1a,".")[0]),
    Protocol = case(Protocol == "", Protocol2, Protocol),
    SourceIP = case(SourceIP == "", SourceIP2, SourceIP),
    TargetIP = case(TargetIP == "", TargetIP2, TargetIP),
    //ICMP records don't have port information
    SourcePort = case(SourcePort == "", "N/A", SourcePort),
    TargetPort = case(TargetPort == "", "N/A", TargetPort),
    //Regular network rules don't have a DNAT destination
    TranslatedDestination = case(TranslatedDestination == "", "N/A", TranslatedDestination), 
    TranslatedPort = case(isnull(TranslatedPort), "N/A", tostring(TranslatedPort)),
    //Rule information
    Policy = case(Policy == "", "N/A", Policy),
    RuleCollectionGroup = case(RuleCollectionGroup == "", "N/A", RuleCollectionGroup ),
    RuleCollection = case(RuleCollection == "", "N/A", RuleCollection ),
    Rule = case(Rule == "", "N/A", Rule)
| project TimeGenerated, msg_s, Protocol, SourceIP,SourcePort,TargetIP,TargetPort,Action, TranslatedDestination, TranslatedPort, Policy, RuleCollectionGroup, RuleCollection, Rule

Dane dziennika reguł analizy zagrożeń

Analizuje dane dziennika reguł analizy zagrożeń.

AzureDiagnostics
| where OperationName  == "AzureFirewallThreatIntelLog"
| parse msg_s with Protocol " request from " SourceIP ":" SourcePortInt:int " to " TargetIP ":" TargetPortInt:int *
| parse msg_s with * ". Action: " Action "." Message
| parse msg_s with Protocol2 " request from " SourceIP2 " to " TargetIP2 ". Action: " Action2
| extend SourcePort = tostring(SourcePortInt),TargetPort = tostring(TargetPortInt)
| extend Protocol = case(Protocol == "", Protocol2, Protocol),SourceIP = case(SourceIP == "", SourceIP2, SourceIP),TargetIP = case(TargetIP == "", TargetIP2, TargetIP),SourcePort = case(SourcePort == "", "N/A", SourcePort),TargetPort = case(TargetPort == "", "N/A", TargetPort)
| sort by TimeGenerated desc 
| project TimeGenerated, msg_s, Protocol, SourceIP,SourcePort,TargetIP,TargetPort,Action,Message

Azure Firewall danych dziennika

Zacznij od tego zapytania, jeśli chcesz przeanalizować dzienniki z reguł sieciowych, reguł aplikacji, reguł NAT, idS, analizy zagrożeń i nie tylko, aby zrozumieć, dlaczego określony ruch był dozwolony lub odrzucony. To zapytanie pokaże ostatnie 100 rekordów dziennika, ale dodając proste instrukcje filtru na końcu zapytania można dostosować wyniki.

// Parses the azure firewall rule log data. 
// Includes network rules, application rules, threat intelligence, ips/ids, ...
AzureDiagnostics
| where Category == "AzureFirewallNetworkRule" or Category == "AzureFirewallApplicationRule"
//optionally apply filters to only look at a certain type of log data
//| where OperationName == "AzureFirewallNetworkRuleLog"
//| where OperationName == "AzureFirewallNatRuleLog"
//| where OperationName == "AzureFirewallApplicationRuleLog"
//| where OperationName == "AzureFirewallIDSLog"
//| where OperationName == "AzureFirewallThreatIntelLog"
| extend msg_original = msg_s
// normalize data so it's eassier to parse later
| extend msg_s = replace(@'. Action: Deny. Reason: SNI TLS extension was missing.', @' to no_data:no_data. Action: Deny. Rule Collection: default behavior. Rule: SNI TLS extension missing', msg_s)
| extend msg_s = replace(@'No rule matched. Proceeding with default action', @'Rule Collection: default behavior. Rule: no rule matched', msg_s)
// extract web category, then remove it from further parsing
| parse msg_s with * " Web Category: " WebCategory
| extend msg_s = replace(@'(. Web Category:).*','', msg_s)
// extract RuleCollection and Rule information, then remove it from further parsing
| parse msg_s with * ". Rule Collection: " RuleCollection ". Rule: " Rule
| extend msg_s = replace(@'(. Rule Collection:).*','', msg_s)
// extract Rule Collection Group information, then remove it from further parsing
| parse msg_s with * ". Rule Collection Group: " RuleCollectionGroup
| extend msg_s = replace(@'(. Rule Collection Group:).*','', msg_s)
// extract Policy information, then remove it from further parsing
| parse msg_s with * ". Policy: " Policy
| extend msg_s = replace(@'(. Policy:).*','', msg_s)
// extract IDS fields, for now it's always add the end, then remove it from further parsing
| parse msg_s with * ". Signature: " IDSSignatureIDInt ". IDS: " IDSSignatureDescription ". Priority: " IDSPriorityInt ". Classification: " IDSClassification
| extend msg_s = replace(@'(. Signature:).*','', msg_s)
// extra NAT info, then remove it from further parsing
| parse msg_s with * " was DNAT'ed to " NatDestination
| extend msg_s = replace(@"( was DNAT'ed to ).*",". Action: DNAT", msg_s)
// extract Threat Intellingence info, then remove it from further parsing
| parse msg_s with * ". ThreatIntel: " ThreatIntel
| extend msg_s = replace(@'(. ThreatIntel:).*','', msg_s)
// extract URL, then remove it from further parsing
| extend URL = extract(@"(Url: )(.*)(\. Action)",2,msg_s)
| extend msg_s=replace(@"(Url: .*)(Action)",@"\2",msg_s)
// parse remaining "simple" fields
| parse msg_s with Protocol " request from " SourceIP " to " Target ". Action: " Action
| extend 
    SourceIP = iif(SourceIP contains ":",strcat_array(split(SourceIP,":",0),""),SourceIP),
    SourcePort = iif(SourceIP contains ":",strcat_array(split(SourceIP,":",1),""),""),
    Target = iif(Target contains ":",strcat_array(split(Target,":",0),""),Target),
    TargetPort = iif(SourceIP contains ":",strcat_array(split(Target,":",1),""),""),
    Action = iif(Action contains ".",strcat_array(split(Action,".",0),""),Action),
    Policy = case(RuleCollection contains ":", split(RuleCollection, ":")[0] ,Policy),
    RuleCollectionGroup = case(RuleCollection contains ":", split(RuleCollection, ":")[1], RuleCollectionGroup),
    RuleCollection = case(RuleCollection contains ":", split(RuleCollection, ":")[2], RuleCollection),
    IDSSignatureID = tostring(IDSSignatureIDInt),
    IDSPriority = tostring(IDSPriorityInt)
| project msg_original,TimeGenerated,Protocol,SourceIP,SourcePort,Target,TargetPort,URL,Action, NatDestination, OperationName,ThreatIntel,IDSSignatureID,IDSSignatureDescription,IDSPriority,IDSClassification,Policy,RuleCollectionGroup,RuleCollection,Rule,WebCategory
| order by TimeGenerated
| limit 100

Azure Firewall danych dziennika serwera proxy DNS

Zacznij od tego zapytania, jeśli chcesz zrozumieć dane dziennika serwera proxy DNS zapory. To zapytanie pokaże ostatnie 100 rekordów dziennika, ale dodając proste instrukcje filtru na końcu zapytania można dostosować wyniki.

// DNS proxy log data 
// Parses the DNS proxy log data. 
AzureDiagnostics
| where Category == "AzureFirewallDnsProxy"
| parse msg_s with "DNS Request: " SourceIP ":" SourcePortInt:int " - " QueryID:int " " RequestType " " RequestClass " " hostname ". " protocol " " details
| extend
    ResponseDuration = extract("[0-9]*.?[0-9]+s$", 0, msg_s),
    SourcePort = tostring(SourcePortInt),
    QueryID =  tostring(QueryID)
| project TimeGenerated,SourceIP,hostname,RequestType,ResponseDuration,details,msg_s
| order by TimeGenerated
| limit 100

Tabela tras protokołu BGP

Tabela tras BPG poznana w ciągu ostatnich 12 godzin.

AzureDiagnostics
| where TimeGenerated > ago(12h)
| where ResourceType == "EXPRESSROUTECIRCUITS"
| project TimeGenerated , ResourceType , network_s , path_s , OperationName

Komunikaty informacyjne protokołu BGP

Komunikaty informacyjne protokołu BGP według poziomu, typu zasobu i sieci.

AzureDiagnostics
| where Level == "Informational"
| project TimeGenerated , ResourceId, Level, ResourceType , network_s , path_s

Punkty końcowe ze stanem monitorowania w dół

Znajdź przyczynę, dla którego stan monitorowania punktów końcowych usługi Azure Traffic Manager nie działa.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceType == "TRAFFICMANAGERPROFILES"  and Category  == "ProbeHealthStatusEvents"
| where Status_s == "Down"
| project TimeGenerated, EndpointName_s, Status_s, ResultDescription, SubscriptionId , _ResourceId

Pomyślne połączenia punkt-lokacja

Pomyślne połączenia punkt-lokacja w ciągu ostatnich 12 godzin.

AzureDiagnostics 
| where TimeGenerated > ago(12h)
| where Category == "P2SDiagnosticLog" and Message has "Connection successful"
| project TimeGenerated, Resource ,Message

Nieudane połączenia punkt-lokacja

Nieudane połączenia punkt-lokacja w ciągu ostatnich 12 godzin.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics 
| where TimeGenerated > ago(12h)
| where Category == "P2SDiagnosticLog" and Message has "Connection failed"
| project TimeGenerated, Resource ,Message

Zmiany konfiguracji bramy

Pomyślne zmiany konfiguracji bramy wprowadzone przez administratora w ciągu ostatnich 24 godzin.

AzureDiagnostics
| where TimeGenerated > ago(24h)
| where Category == "GatewayDiagnosticLog" and operationStatus_s == "Success" and configuration_ConnectionTrafficType_s == "Internet"
| project TimeGenerated, Resource, OperationName, Message, operationStatus_s

Zdarzenia połączenia/rozłączenia tunelu S2S

Zdarzenia połączenia/rozłączenia tunelu S2S w ciągu ostatnich 24 godzin.

AzureDiagnostics 
| where TimeGenerated > ago(24h)
| where Category == "TunnelDiagnosticLog" and (status_s == "Connected" or status_s == "Disconnected")
| project TimeGenerated, Resource , status_s, remoteIP_s, stateChangeReason_s

Aktualizacje tras protokołu BGP

Aktualizacje trasy protokołu BGP w ciągu ostatnich 24 godzin.

AzureDiagnostics
| where TimeGenerated > ago(24h)
| where Category == "RouteDiagnosticLog" and OperationName == "BgpRouteUpdate"

Pokaż dzienniki z tabeli AzureDiagnostics

Listy najnowsze dzienniki w tabeli AzureDiagnostics posortowane według czasu (najnowsza pierwsza).

AzureDiagnostics
| top 10 by TimeGenerated

Zapytania dotyczące usługi microsoft.recoveryservices

Zadania tworzenia kopii zapasowej, które zakończyły się niepowodzeniem

Znajdowanie dzienników zgłoszonych nieudanych zadań tworzenia kopii zapasowej z ostatniego dnia.

AzureDiagnostics  
| where ResourceProvider == "MICROSOFT.RECOVERYSERVICES" and Category == "AzureBackupReport"  
| where OperationName == "Job" and JobOperation_s == "Backup" and JobStatus_s == "Failed" 
| project TimeGenerated, JobUniqueId_g, JobStartDateTime_s, JobOperation_s, JobOperationSubType_s, JobStatus_s , JobFailureCode_s, JobDurationInSecs_s , AdHocOrScheduledJob_s

Zapytania dotyczące microsoft.servicebus

[Klasyczny] Wyświetlanie listy operacji zarządzania

Spowoduje to wyświetlenie wszystkich wywołań zarządzania.

AzureDiagnostics
| where ResourceProvider ==\"MICROSOFT.SERVICEBUS\"
| where Category == \"OperationalLogs\"
| summarize count() by EventName_s, _ResourceId

[Klasyczny] Podsumowanie błędu

Podsumowuje wszystkie napotkane błędy.

AzureDiagnostics
| where ResourceProvider ==\"MICROSOFT.SERVICEBUS\"
| where Category == \"Error\"
| summarize count() by EventName_s, _ResourceId

[Klasyczny] Próba dostępu do usługi Keyvault — nie znaleziono klucza

Podsumowuje dostęp do usługi keyvault, gdy klucz nie zostanie znaleziony.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == \"MICROSOFT.SERVICEBUS\"
| where Category == \"Error\" and OperationName == \"wrapkey\"
| project Message, _ResourceId

[Klasyczny] Jednostki autodeletowane

Podsumowanie wszystkich jednostek, które zostały automatycznie usunięte.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == \"MICROSOFT.SERVICEBUS\"
| where Category == \"OperationalLogs\"
| where EventName_s startswith \"AutoDelete\"
| summarize count() by EventName_s, _ResourceId

[Klasyczny] Usługa Keyvault wykonała operację

Podsumowuje operację wykonaną za pomocą usługi keyvault, aby wyłączyć lub przywrócić klucz.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == \"MICROSOFT.SERVICEBUS\"
| where (Category == \"info\" and (OperationName == \"disable\" or OperationName == \"restore\"))
| project Message, _ResourceId

Operacje zarządzania w ciągu ostatnich 7 dni

Spowoduje to wyświetlenie wszystkich wywołań zarządzania w ciągu ostatnich 7 dni.

AzureDiagnostics
| where TimeGenerated > ago(7d)
| where ResourceProvider =="MICROSOFT.SERVICEBUS"
| where Category == "OperationalLogs"
| summarize count() by EventName_s, _ResourceId

Podsumowanie błędów

Podsumowuje wszystkie błędy widoczne w ciągu ostatnich 7 dni.

AzureDiagnostics
| where TimeGenerated > ago(7d)
| where ResourceProvider =="MICROSOFT.SERVICEBUS"
| where Category == "Error" 
| summarize count() by EventName_s, _ResourceId

Próba dostępu do usługi Keyvault — nie znaleziono klucza

Podsumowuje dostęp do usługi keyvault, gdy klucz nie zostanie znaleziony.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.SERVICEBUS" 
| where Category == "Error" and OperationName == "wrapkey"
| project Message, _ResourceId

Jednostki autodeletowane

Podsumowanie wszystkich jednostek, które zostały automatycznie usunięte.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.SERVICEBUS"
| where Category == "OperationalLogs"
| where EventName_s startswith "AutoDelete"
| summarize count() by EventName_s, _ResourceId

Usługa Keyvault wykonała operację

Podsumowuje operację wykonaną za pomocą usługi keyvault, aby wyłączyć lub przywrócić klucz.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.SERVICEBUS"
| where (Category == "info" and (OperationName == "disable" or OperationName == "restore"))
| project Message, _ResourceId

Zapytania dotyczące microsoft.sql

Magazyn w wystąpieniach zarządzanych powyżej 90%

Wyświetl wszystkie wystąpienia zarządzane z użyciem magazynu powyżej 90%.

// To create an alert for this query, click '+ New alert rule'
let storage_percentage_threshold = 90;
AzureDiagnostics
| where Category =="ResourceUsageStats"
| summarize (TimeGenerated, calculated_storage_percentage) = arg_max(TimeGenerated, todouble(storage_space_used_mb_s) *100 / todouble (reserved_storage_mb_s))
   by _ResourceId
| where calculated_storage_percentage > storage_percentage_threshold

Wykorzystanie procesora CPU przekracza 95% w wystąpieniach zarządzanych

Wyświetl wszystkie wystąpienia zarządzane z udziałem procesora CPU w ponad 95% stanu.

// To create an alert for this query, click '+ New alert rule'
let cpu_percentage_threshold = 95;
let time_threshold = ago(1h);
AzureDiagnostics
| where Category == "ResourceUsageStats" and TimeGenerated > time_threshold
| summarize avg_cpu = max(todouble(avg_cpu_percent_s)) by _ResourceId
| where avg_cpu > cpu_percentage_threshold

Wyświetlanie wszystkich aktywnych inteligentnych szczegółowych informacji

Wyświetl wszystkie aktywne problemy z wydajnością wykryte przez inteligentne szczegółowe informacje. Należy pamiętać, że dziennik sqlInsights musi być włączony dla każdej monitorowanej bazy danych.

AzureDiagnostics
| where Category == "SQLInsights" and status_s == "Active"
| distinct rootCauseAnalysis_s

Statystyki oczekiwania

Statystyki oczekiwania w ciągu ostatniej godziny według serwera logicznego i bazy danych.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.SQL"
| where TimeGenerated >= ago(60min)
| parse _ResourceId with * "/microsoft.sql/servers/" LogicalServerName "/databases/" DatabaseName
| summarize Total_count_60mins = sum(delta_waiting_tasks_count_d) by LogicalServerName, DatabaseName, wait_type_s

Zapytania dotyczące usługi microsoft.streamanalytics

Wyświetlanie listy wszystkich błędów danych wejściowych

Pokazuje wszystkie błędy, które wystąpiły podczas przetwarzania danych z danych wejściowych.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics 
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and parse_json(properties_s).Type == "DataError" 
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Wyświetlanie listy wszystkich błędów deserializacji danych wejściowych

Pokazuje błędy spowodowane źle sformułowanych zdarzeń, których nie można deserializować przez zadanie.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and parse_json(properties_s).DataErrorType in ("InputDeserializerError.InvalidData", "InputDeserializerError.TypeConversionError", "InputDeserializerError.MissingColumns", "InputDeserializerError.InvalidHeader", "InputDeserializerError.InvalidCompressionType")
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Wyświetl wszystkie błędy InvalidInputTimeStamp

Pokazuje błędy spowodowane zdarzeniami, w których nie można przekonwertować wartości wyrażenia TIMESTAMP BY na datę/godzinę.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and  parse_json(properties_s).DataErrorType == "InvalidInputTimeStamp"
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Wyświetl wszystkie błędy InvalidInputTimeStampKey

Pokazuje błędy spowodowane zdarzeniami, w których wartość sygnatury CZASOWEJ BY OVER timestampColumn ma wartość NULL.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and  parse_json(properties_s).DataErrorType == "InvalidInputTimeStampKey"
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Zdarzenia, które przybyły późno

Pokazuje błędy spowodowane zdarzeniami, w których różnica między czasem aplikacji a czasem przybycia jest większa niż zasady spóźnienia przyjazdu.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and  parse_json(properties_s).DataErrorType == "LateInputEvent"
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Wydarzenia, które przybyły wcześnie

Pokazuje błędy spowodowane zdarzeniami, w których różnica między czasem aplikacji a czasem przyjazdu jest większa niż 5 minut.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and parse_json(properties_s).DataErrorType == "EarlyInputEvent"
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Zdarzenia, które dotarły poza zamówienie

Pokazuje błędy spowodowane zdarzeniami, które docierają z zamówienia zgodnie z zasadami poza kolejnością.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and parse_json(properties_s).DataErrorType == "OutOfOrderEvent"
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Wszystkie błędy danych wyjściowych

Pokazuje wszystkie błędy, które wystąpiły podczas zapisywania wyników zapytania do danych wyjściowych w zadaniu.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and parse_json(properties_s).DataErrorType in ("OutputDataConversionError.RequiredColumnMissing", "OutputDataConversionError.ColumnNameInvalid", "OutputDataConversionError.TypeConversionError", "OutputDataConversionError.RecordExceededSizeLimit", "OutputDataConversionError.DuplicateKey")
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Wyświetl wszystkie błędy RequiredColumnMissing

Pokazuje wszystkie błędy, w których brakuje rekordu wyjściowego utworzonego przez zadanie.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and parse_json(properties_s).DataErrorType == "OutputDataConversionError.RequiredColumnMissing"
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Wyświetlanie listy wszystkich błędów ColumnNameInvalid

Pokazuje błędy, w których rekord wyjściowy utworzony przez zadanie ma nazwę kolumny, która nie jest mapowany na kolumnę w danych wyjściowych.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and parse_json(properties_s).DataErrorType == "OutputDataConversionError.ColumnNameInvalid"
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Wyświetlanie listy wszystkich błędów TypeConversionError

Pokazuje błędy, w których rekord wyjściowy utworzony przez zadanie zawiera kolumnę, której nie można przekonwertować na prawidłowy typ w danych wyjściowych.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and parse_json(properties_s).DataErrorType == "OutputDataConversionError.TypeConversionError"
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Wyświetl wszystkie błędy RecordExceededSizeLimit

Pokazuje błędy, w których rozmiar rekordu wyjściowego wygenerowanego przez zadanie jest większy niż obsługiwany rozmiar danych wyjściowych.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and  parse_json(properties_s).DataErrorType == "OutputDataConversionError.RecordExceededSizeLimit"
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Wyświetl wszystkie błędy DuplicateKey

Pokazuje błędy, w których rekord wyjściowy utworzony przez zadanie zawiera kolumnę o takiej samej nazwie jak kolumna System.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and parse_json(properties_s).DataErrorType == "OutputDataConversionError.DuplicateKey"
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Wszystkie dzienniki z poziomem "Błąd"

Pokazuje wszystkie dzienniki, które prawdopodobnie negatywnie wpływają na zadanie.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and Level == "Error" 
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Operacje, które mają wartość "Niepowodzenie"

Pokazuje wszystkie operacje w zadaniu, które spowodowały awarię.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and status_s == "Failed" 
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Dzienniki ograniczania przepływności danych wyjściowych (Cosmos DB, Power BI, Event Hubs)

Pokazuje wszystkie wystąpienia, w których zapisywanie w jednym z danych wyjściowych zostało ograniczone przez usługę docelową.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and parse_json(properties_s).Type in ("DocumentDbOutputAdapterWriteThrottlingError", "EventHubOutputAdapterEventHubThrottlingError", "PowerBIServiceThrottlingError", "PowerBIServiceThrottlingError")
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Błędy przejściowe danych wejściowych i wyjściowych

Przedstawia wszystkie błędy związane z danymi wejściowymi i wyjściowymi, które są sporadyczne.

// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and parse_json(properties_s).Type in ("AzureFunctionOutputAdapterTransientError", "BlobInputAdapterTransientError", "DataLakeOutputAdapterTransientError", "DocumentDbOutputAdapterTransientError", "EdgeHubOutputAdapterEdgeHubTransientError", "EventHubBasedInputInvalidOperationTransientError", "EventHubBasedInputOperationCanceledTransientError", "EventHubBasedInputTimeoutTransientError", "EventHubBasedInputTransientError", "EventHubOutputAdapterEventHubTransientError", "InputProcessorTransientFailure", "OutputProcessorTransientError", "ReferenceDataInputAdapterTransientError", "ServiceBusOutputAdapterTransientError", "TableOutputAdapterTransientError")
| project TimeGenerated, Resource, Region_s, OperationName, properties_s, Level, _ResourceId

Podsumowanie wszystkich błędów danych w ciągu ostatnich 7 dni

Podsumowanie wszystkich błędów danych w ciągu ostatnich 7 dni.

AzureDiagnostics
| where TimeGenerated > ago(7d) //last 7 days
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and parse_json(properties_s).Type == "DataError"
| extend DataErrorType = tostring(parse_json(properties_s).DataErrorType)
| summarize Count=count(), sampleEvent=any(properties_s)  by DataErrorType, JobName=Resource

Podsumowanie wszystkich błędów w ciągu ostatnich 7 dni

Podsumowanie wszystkich błędów w ciągu ostatnich 7 dni.

AzureDiagnostics
| where TimeGenerated > ago(7d) //last 7 days
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS"
| extend ErrorType = tostring(parse_json(properties_s).Type)
| summarize Count=count(), sampleEvent=any(properties_s)  by ErrorType, JobName=Resource

Podsumowanie operacji "Niepowodzenie" w ciągu ostatnich 7 dni

Podsumowanie operacji "Niepowodzenie" w ciągu ostatnich 7 dni.

AzureDiagnostics
| where TimeGenerated > ago(7d) //last 7 days
| where ResourceProvider == "MICROSOFT.STREAMANALYTICS" and status_s == "Failed" 
| summarize Count=count(), sampleEvent=any(properties_s) by JobName=Resource