2
I have an error log that I would like to filter out all the known errors using Powershell. I know how to filter by line in powershell, but my problem is that the errors in the error log span multiple lines, but they always start with a date time. Eg:
2016-01-14 01:01:01 Error 1: blab blab blab
blab blab blab line 1
blab blab blab line 2
blab blab blab line 3
2016-01-14 02:33:04 Error 2: blab blab blab
blab blab blab line 1
blab blab blab line 2
2016-01-14 02:33:04 Error 3: blab blab blab
blab blab blab line 1
and I wanted to filter out Error 1 and Error3, so the output will only be:
2016-01-14 02:33:04 Error 2: blab blab blab
blab blab blab line 1
blab blab blab line 2
Is there some way easy to group (by the date time) and filter them using powershell?
Thanks in advance!