I have a log file that is written every day and I would like to have a script to check it for certain entries. Below is an example of the log:
11/30/2006 6:00:01 AM - Starting Script
11/30/2006 6:00:01 AM - All servers appear to be online
11/30/2006 6:00:08 AM - No reported pending CHKDSK for any defined servers
11/30/2006 6:00:08 AM - No disk space issues found on servers
11/30/2006 6:00:08 AM - All defined services on NWPSRV21 appear to be running.
11/30/2006 6:00:08 AM - All defined services on NWPSRV11 appear to be running.
11/30/2006 6:00:09 AM - All defined services on TWPSRV21 appear to be running.
11/30/2006 6:00:11 AM !- UWPSRV09 Radia Configuration Server is Stopped
I would like the script to read the log file and list the lines that have "!-" indicating an error. How can I use streamreader to find only these lines and create them into a variable? Chad
Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.