From 62c3103c9e282b6f67fbd5865512c962f93ae784 Mon Sep 17 00:00:00 2001 From: Vincent Tran Date: Tue, 6 Aug 2024 10:21:56 -0700 Subject: [PATCH] Upgraded to Get-WinEvent cmdlet (#1911) Co-authored-by: Vincent Tran --- log-collector-script/windows/eks-log-collector.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/log-collector-script/windows/eks-log-collector.ps1 b/log-collector-script/windows/eks-log-collector.ps1 index 919666404..407858460 100644 --- a/log-collector-script/windows/eks-log-collector.ps1 +++ b/log-collector-script/windows/eks-log-collector.ps1 @@ -268,7 +268,7 @@ Function get_eks_logs{ Function get_k8s_info{ try { Write-Host "Collecting Kubelet logs" - Get-EventLog -LogName EKS -Source kubelet | Export-CSV $info_system/kubelet/kubelet-service.csv + Get-WinEvent -ProviderName kubelet | Export-CSV $info_system/kubelet/kubelet-service.csv Write-Host "OK" -foregroundcolor "green" } catch{ @@ -278,7 +278,7 @@ Function get_k8s_info{ try { Write-Host "Collecting Kube-proxy logs" - Get-EventLog -LogName EKS -Source kube-proxy | Export-CSV $info_system/kube-proxy/kube-proxy-service.csv + Get-WinEvent -ProviderName kube-proxy | Export-CSV $info_system/kube-proxy/kube-proxy-service.csv Write-Host "OK" -foregroundcolor "green" } catch{ @@ -303,7 +303,7 @@ Function get_docker_logs{ Write-Host "Collecting Docker daemon logs" if (check_service_installed_and_running "docker") { try { - Get-EventLog -LogName Application -Source Docker | Export-CSV $info_system/docker_log/docker-daemon.csv + Get-WinEvent -ProviderName Docker | Export-CSV $info_system/docker_log/docker-daemon.csv Write-Host "OK" -foregroundcolor "green" } catch {