Skip to content

Commit

Permalink
Upgraded to Get-WinEvent cmdlet (#1911)
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Tran <vinvtran@amazon.com>
  • Loading branch information
VincentVTran and Vincent Tran authored Aug 6, 2024
1 parent 069c0eb commit 62c3103
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions log-collector-script/windows/eks-log-collector.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{
Expand All @@ -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 {
Expand Down

0 comments on commit 62c3103

Please sign in to comment.