Partilhar via


LogFileParser with PowerShell

Hi all,

I have created a sample project for the PowerShell Conference Asia 2017 to demonstrate PowerShell Classes and its possible benefit. The project 'LogFileParser' by itself can be quiet useful and is completely extendable by capabilities in terms of log file types and filtering functions and therefore I wanted to share it with you.

The idea, which I used primarily for this, was filtering with RegEx as I have described in detail here.

 

You can find it in my Github and download it directly here.


Structure:


Examples:

Supported Types for now:

Loaded LogFileTypeClasses

CBS

DISM

Robocopy Output

All System Center Configuration Manager log files

Upgrade Logs: setupact.log & setuperr.log

WindowsUpdate.log

It is dynamically extendable and you can easily add your own LogClassFileTypes based on RegEx or add additional functions to LogFileTypes or even overwrite the parsing mechanism:

LogFileTypeClass with RegEx

Additional functions for a defined log file type - here WindowsUpdateLog:

You can just inherit the default class 'ParsedLogFile' and just add your functions for this particular log file types - example: GetWindowsUpdates in the WindowsUpdate.log:

I hope you like it.

All the best,


David das Neves

Premier Field Engineer, EMEA, Germany
Windows Client, PowerShell, Security