This article describes how to collect Windows event logs from Azure Kubernetes Service (AKS) pods.
To retrieve Windows event logs from AKS pod via Azure Command-Line Interface (CLI):
az account set --subscription <subscription ID>
az aks get-credentials --resource-group <Resource Group Name> --name <AKS name> --admin
kubectl -n <pod namespace> exec pod/<Pod Name> -it -- powershell.exe
Get-EventLog -LogName application
Get-EventLog -LogName system
Note: The default PowerShell table formatting might truncate the results. To prevent truncation, consider appending the Get-EventLog commands with | Format-Table -AutoSize -Wrap.
For example:
Get-EventLog -LogName application | Format-Table -AutoSize -Wrap
For alternative methods, refer to this article: https://stackoverflow.com/questions/1443569/powershell-get-eventlog-message-column-is-too-short.