Last active
July 29, 2022 02:27
-
-
Save binura-g/16b2ffaa0f0864a8b33e5ecf63cc54eb to your computer and use it in GitHub Desktop.
Kusto-AKS Pod Logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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