Poznámka:
Přístup k této stránce vyžaduje autorizaci. Můžete se zkusit přihlásit nebo změnit adresáře.
Přístup k této stránce vyžaduje autorizaci. Můžete zkusit změnit adresáře.
Informace o používání těchto dotazů na webu Azure Portal najdete v kurzu služby Log Analytics. Informace o rozhraní REST API najdete v tématu Dotaz.
Vyhledání hodnoty v tabulce protokolů kontejnerů
** Tento dotaz vyžaduje ke spuštění parametru. Tabulka Protokoly kontejnerů se používá k ukládání řádků protokolu, které byly shromážděné ze streamů stdout a stderr z kontejnerů. Tento dotaz najde řádky v tabulce ContainerLogs, kde LogEntry obsahuje specifikovaný řetězec.
//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
Fakturovatelná data záznamů podle typu protokolu
Prohlédněte si fakturovatelná data protokolů kontejnerů za posledních 7 dní, oddělené podle typu protokolu.
// 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
Výpis protokolů kontejneru podle oboru názvů
Zobrazit protokoly kontejnerů ze všech jmenných prostorů v clusteru.
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
Najít v ContainerLogu
Vyhledejte v ContainerLogu konkrétní hodnotu v tabulce ContainerLog./nNote, že tento dotaz vyžaduje aktualizaci parametru <SeachValue> pro dosažení výsledků.
// 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