Get-Log command

GET-LOG this  cmdlet retrieves entries from vSphere logs. Returns portions of the log files according to the criteria provided by the cmdlet parameters.
To specify a server different from the default one, use the Server parameter.

Examples

1. These are the VirtualCenter log files
Get-LogType

 

2. Get-Log from specyfic host
Get-LogType -VMhost esx1.vmlab.local

 

3. Retrieve a bundle log for the specified host.
Get-VMHost Host | Get-Log -Bundle -DestinationPath “D:\VMHostBundeLog”

 

4. Retrieve the first one hundred log lines for the specified host and key
$vmhost = Get-VMHost Host
$keyList = Get-LogType -VMHost $vmhost
$vmhost | Get-Log -Key $keyList[0] -StartLineNum 1 -NumLines 100

 

5.These are specyfic EXSi host Log Type
Get-VMHost Testesx01* |Get-LogType

 

6.This command willget all the information from the vmkernel log file
(Get-Log -VMHost (Get-VMHost testesx01*) vmkernel).Entries

 

7. This command willget all WARNING from the vmkernel log file
(Get-Log -VMHost (Get-VMHost testesx01*) vmkernel).Entries | Where {$_ -like “*WARNING*“}

 

 

 

Please Comment and Subscribe

Loading

Leave a Reply

Your email address will not be published. Required fields are marked *