I've been having some problem in using FIND or FINDSTR command to find a particular string in a log file and return its output with the matching string along with 1 line above and 1 line below the matching line.
So far, this is the only command that I've tried. I've tried to search online, but couldn't find anything useful.
findstr /n "NETWORK ISSUE DETECTED" c:\Log.txt
Sample log data (Log.txt):
1371524155 Tue Jun 18 10:55:55 2013 1371524160 Tue Jun 18 10:56:00 2013 1371524165 Tue Jun 18 10:56:05 2013 NETWORK ISSUE DETECTED 1371523243 Tue Jun 18 10:40:43 2013 1371523248 Tue Jun 18 10:40:48 2013 1371523253 Tue Jun 18 10:40:53 2013
Desire output:
1371524165 Tue Jun 18 10:56:05 2013 NETWORK ISSUE DETECTED 1371523243 Tue Jun 18 10:40:43 2013
Appreciate for your kind help.
Thank you.