FunctionAppLogs tablosu için sorgular
Azure portalında bu sorguları kullanma hakkında bilgi için bkz . Log Analytics öğreticisi. REST API için bkz . Sorgu.
İşlev Uygulamalarından uygulama günlüklerini gösterme
Zamana göre sıralanmış uygulama günlüklerinin listesi (en son günlükler önce gösterilir).
FunctionAppLogs
| project TimeGenerated, HostInstanceId, Message, _ResourceId
| sort by TimeGenerated desc
Uyarıları veya özel durumları olan günlükleri gösterme
Uyarılar veya özel durumlar içeren günlüklerin listesi (en son günlükler önce gösterilir).
FunctionAppLogs
| where Level == "Warning" or Level == "Error"
| project TimeGenerated, HostInstanceId, Level, Message, _ResourceId
| sort by TimeGenerated desc
Hata ve özel durum sayısı
Uygulama başına son bir saat içinde uyarı veya hata içeren günlük sayısının sütun grafiğini gösterin.
FunctionAppLogs
| where TimeGenerated > ago(1h)
| where Level == "Warning" or Level == "Error"
| summarize count_per_app = count() by _ResourceId
| sort by count_per_app desc
| render columnchart
Zaman içindeki işlev etkinliği
İşlev istekleri hacminin zaman içindeki İşlev başına eğilimini gösteren çizgi grafik.
FunctionAppLogs
//| where _ResourceId == "MyResourceId" // Uncomment and enter a resource ID to get results for a specific resource
| where Category startswith "Function." and Message startswith "Executed "
| summarize count() by bin(TimeGenerated, 1h), FunctionName // Aggregate by hour
| render timechart
İşlev sonuçları
Tek tek İşlev çağırması son saatle sonuçlandı (en son günlükler önce gösterilir).
FunctionAppLogs
| where TimeGenerated > ago(1h)
| where Category startswith "Function." and Message startswith "Executed "
| parse Message with "Executed '" Name "' (" Result ", Id=" Id ", Duration=" Duration:long "ms)"
| project TimeGenerated, FunctionName, Result, FunctionInvocationId, Duration, _ResourceId
| sort by TimeGenerated desc
İşlev Hatası oranı
İşlevlerin başarı ve hataları saatlik özetleme.
FunctionAppLogs
| where Category startswith "Function." and Message startswith "Executed "
| parse Message with "Executed '" Name "' (" Result ", Id=" Id ", Duration=" Duration:long "ms)"
// | where Name == "MyFunction" // Use this to restrict to a specific function
| summarize count() by bin(TimeGenerated, 1h), Name, Result, _ResourceId
| order by TimeGenerated desc