Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Using Regular Expressions and Event Viewer with PowerShell

$
0
0
Today a customer asked me to assist him to filter an Event Viewer log file.
The customer figured out a lot of connection’s errors with the Oracle database. The errors were being written to the Event Viewer and, as the number of errors was huge, so it was hard to customer to identify all the errors were of the same type (ORA-02067).
I informed the customer that it was possible to use PowerShell and Regular Expressions (RegEx) to help to retrieve the Event Viewer logs.
Let me show an example of how to retrieve the records of the Application log of Event Viewer. I am filtering the logs by the current date and putting the result in a variable.

Viewing all articles
Browse latest Browse all 6937

Trending Articles