Skip to content

Instantly share code, notes, and snippets.

@cicorias
Last active August 5, 2021 10:34
Show Gist options
  • Save cicorias/3a9ed8f2d5a66b6c0e438048aa57aca1 to your computer and use it in GitHub Desktop.
Save cicorias/3a9ed8f2d5a66b6c0e438048aa57aca1 to your computer and use it in GitHub Desktop.
kubernetes aks insights
// List container logs per namespace
// View container logs from all the namespaces in the cluster.
let window=ago(48h);
ContainerLog
|join(KubePodInventory |where TimeGenerated > startofday(window))//KubePodInventory Contains namespace information
on ContainerID
|where TimeGenerated > startofday(window)
|where LogEntry contains "failed to start"
| project ContainerID, TimeGenerated ,Namespace , LogEntrySource , LogEntry
//| distinct ContainerID
let window=ago(48h);
ContainerLog
|join(KubePodInventory |where TimeGenerated > startofday(window))//KubePodInventory Contains namespace information
on ContainerID
|where TimeGenerated > startofday(window)
|where LogEntry contains "InstrumentationK" //"failed to start"
| project SourceSystem, ContainerID, InstanceName, ContainerName, TimeGenerated ,Namespace , LogEntrySource , LogEntry, PodLabel, ServiceName, Image, ImageTag
//| distinct ServiceName // ContainerID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment