Veeam log file analysis with PowerShell

A few weeks ago I did an Update of the Veeam Backup & Replication environment in my Lab. After the update I wanted to make sure everything went fine and started analyzing all event logs and file logs during and after the update. I quickly realized that the Veeam log file analysis without a proper tool will take a while. Since my last public PowerShell project was already a few month ago (and I was looking for a use case for PowerShell Classes), I have started to create a Function for the Veeam log file analysis with PowerShell.

Veeam log file analysis with PowerShell - Invoke-VeeamLogParser -LogType PowerShell

Veeam log file analysis

Per default all of the Veeam log files are located in ‘C:\ProgramData\Veeam\<Product>’. Most of the relevant Veeam Services create in their Sub-Folder a log file like these: ‘Svc.VeeamEndpointBackup.log’ (Veeam Agent for Microsoft Windows).

Most of the Veeam log files have the same schema for the main part:

The analysis with PowerShell

PowerShell is a great tool for quickly grep data from files with a given schema:

These two lines return all Error messages in the Veeam Agent for Microsoft Windows log file.

Executing these commands for all the relevant log files is not really comfortable, so I have decided to create a PowerShell module with a function for the Veeam log file analysis. The function should have inputs for the log that should be analyzed and some optional parameters to modify the output of the messages.

This Example shows the output of all known (by the function) log files limited to the last Error or Warning message per file:

Veeam log file analysis with PowerShell - Invoke-VeeamLogParser -LogType All

If the output parameter -Context 2  is used all message are shown in context. The Warning or Error messages are highlighted by a >:

Veeam log file analysis with PowerShell - Invoke-VeeamLogParser -LogType PowerShell

Main function of the PowerShell module

Contribute to the PowerShell Module

In case you hit any bug or have any enhancement request feel free to open an issue or submit a pull request.

Get the PowerShell Module

The PowerShell Module is available on GitHub and in the PowerShell Gallery:

VeeamLogParser – GitHub VeeamLogParser – PS Gallery

 

 

Leave a Reply