Hi,
I have a log file, I need compare previous date end time & current date end time (based on the system).
If the current end time does not find in the log, trigger an email.
If current end time finds in the log, attach the log.
Log details:
Data Start Time - 2018-02-18 22.30.00
Data End Time - 2018-02-19 00.55.50
Time taken for whole process - 8544
Data Start Time - 2018-02-19 22.30.00
Script:
$log = Get-ChildItem c:\opscripts\test\server01\test.log $results = switch -Regex -File $log { 'Data (Start|End) .*' {$Matches[0]} 'Time taken for whole process.*' {$Matches[0]} }
-Kalyan