Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Information om hur du använder dessa frågor i Azure Portal finns i Log Analytics-självstudien. Information om REST-API:et finns i Fråga.
Hitta ett värde i containerloggtabellen
** Den här frågan kräver att en parameter körs. Tabellen ContainerLoggar används för att samla in loggar från stdout- och stderr-strömmar för containrar. Den här frågan hittar rader i tabellen ContainerLogs där LogEntry har angett Sträng.
//This qeury requires a parameter to work.
//The ContainerLog table holds Log lines collected from stdout and stderr streams for containers.
//Note: the query runs by default for the last 24 hours. Use the time pikcer to adjust time span for query
let FindString = "";//Please update term you would like to find in LogEntry here
ContainerLog
| where LogEntry has FindString
|take 100
Fakturerbara loggdata efter loggtyp
Se fakturerbara data för containerloggar för de senaste 7 dagar, uppdelade efter loggtyp.
// Set the requested time, anytime greater than 15d can take longer
let billableTimeView = 7d;
//Join ContainerLog on KubePodInventory for LogEntry source
ContainerLog
| join(KubePodInventory | where TimeGenerated > startofday(ago(billableTimeView)))on ContainerID
| where TimeGenerated > startofday(ago(billableTimeView))
| summarize Total=sum(_BilledSize)/ 1000 by bin(TimeGenerated, 1d), LogEntrySource
Lista containerloggar per namnområde
Visa containerloggar från alla namnområden i klustret.
ContainerLog
|where TimeGenerated > startofday(ago(1h))
|join(
KubePodInventory
| where TimeGenerated > startofday(ago(1h))
| distinct Computer, ContainerID, Namespace
)//KubePodInventory Contains namespace information
on Computer, ContainerID
| project TimeGenerated, ContainerID, Namespace , LogEntrySource , LogEntry
Sök i ContainerLog
Sök i ContainerLog för att söka efter ett specifikt värde i tabellen ContainerLog./nAnteckning om att den här frågan kräver att seachValue-parametern< uppdateras >för att ge resultat
// 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.
ContainerLog
| where * contains tostring(SearchValue)
| take 1000