AKS ポッドからWindows イベント ログを収集する方法


概要

この記事では、Azure Kubernetes Service(AKS)ポッドからWindows イベント ログを収集する方法について説明します。

Windows イベント ログを収集する

Azure Command-Line Interface(CLI)を使用してAKS ポッドからWindows イベント ログを収集するには、以下の手順を実施してください。

  1. 次のコマンドを実行し、必要なサブスクリプションに切り替えます:
    az account set --subscription <subscription ID>
  2. 次を実行します:
    az aks get-credentials --resource-group <Resource Group Name> --name <AKS name> --admin
  3. ポッドでPowershellを起動し、そこで次のPowerShellコマンドを実行します:
    kubectl -n <pod namespace> exec pod/<Pod Name> -it -- powershell.exe
  4. アプリケーション ログを取得するには、PowerShell内で次のコマンドを実行します:
    Get-EventLog -LogName application
  5. システム ログを取得するには、PowerShell内で次のコマンドを実行します:
    Get-EventLog -LogName system