Extract data from log file from or after the specific date

Hi , I am having a script which will start a process and appends the process related logs to a log file. The log file writes logs with every line starting with date in the format of: date +"%Y %b %d %H:%M:%S".
So, in the script, before I start the process, I am storing the date as DATE=`date +"%Y %b %d %H:%M:%S"`
How do I only extract the logs from that log file only from that specific date till the end of the log file. If I can do that, I can grep for errors or exceptions and incorporate in the same script.

Note: the date I stored need not be in the log file, but I have to get the logs after that date from the file.

Thanks,
Chiru

Try this:

awk -v var=$YourDate '!p && $0 ~ var{p=1}p' file

Regards

I didn't read the note, if you have the date only at the start point:

awk -v var=$YourDate '$0 ~ var{p=1;next}p' file

Thanks Franklin, it doesn't work if the date is not present in the log file, but if the date is in the log file, it works like a charm.

Any insight?

Thanks,
Chiru

How do you want to recognize the start point without a date in the log file?

Regards

hey Franklin, I'll have the date as a parameter to grep the log file. I am looking to get the logs after that date from the file even if that date is not available in the file.

Thanks..