Working to print lines that match a specific pattern between a start time and an end time.
Example log line:
Fri Mar 01 HH:MM:SS YYYY:thresholdcrossed
I am looking for an equivalent of the following:
cat /path/file.log | egrep -v "exec|param" | grep thresholdcrossed | sed -n /$start/,/$stop/ >output.file
The start and stop will be user generated variables based on the start and stop times they are searching.
This will give me matches for a single line using regular expressions, but I can't get all lines that match between 2 time stamps.
for line in hand:
line = line.rstrip()
if re.search("Mar 10 21.+:.+tstat-threshcrosso", line) :
print line