Skip to content

Instantly share code, notes, and snippets.

@binura-g
Last active July 29, 2022 02:27
Show Gist options
  • Save binura-g/16b2ffaa0f0864a8b33e5ecf63cc54eb to your computer and use it in GitHub Desktop.
Save binura-g/16b2ffaa0f0864a8b33e5ecf63cc54eb to your computer and use it in GitHub Desktop.
Kusto-AKS Pod Logs
let _Namespace = "Your Namespace";
let _ServiceName = "Name of your deployment";
let _ContainerName = "Name of the container"; // Only required if you have multiple containers in the Pod (ie. Sidecars)
KubePodInventory
| project ContainerID, ContainerName, Namespace
| where Namespace == _Namespace
| where ServiceName == _ServiceName
| where ContainerName hasprefix_cs _ContainerName
| distinct ContainerID
| join kind=inner ContainerLog on ContainerID
// Uncomment the following line to filter out Log entries
// | where LogEntry has "{filter/search text}"
| project TimeGenerated, LogEntry
| order by TimeGenerated desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment