As many seem to be busy here, I suppose you will have to make a little more effort in order to find rapid help, like giving you OS and its version, the shell you use, and in this case
It seems not working. is a bit light... In what way? the best is to give the output you got and explain what you see isn't right, or what was expected
@qshaan, Thank you for sharing your efforts in form of code here. But to me your requirement is still not clear. Could you please post sample of Input and sample of expected output and let us know then.
Thanks Ravinder.. The requirement is to filter events occured on current date from logfile.. The date format in logfile is yymmdd.. The below code seems to be working perfectly.. If u can any other suggestion . Will really appreciate
$ awk -v date="$(date +'%g%m%d')" '{a[++i]=$0;}END{for (j=1;j<NR;j++) {if (a[j]~date) {for (y=0;y<7;y++) print a[j+y]}}}' ALLIP_HC_Log
A2/SW-DEV "AA1J_1.9_IPA01" 009 200323 0341
BLADE
SOURCE CP 07
SUA SS7 DESTINATION INACCESSIBLE
DEST SPIDNT REASON
2-1111 SM22 DEST UNREACHABLE
A2/SW-DEV "AA1J_1.9_IPA01" 012 200323 0341
BLADE
SOURCE CP 07
SUA SS7 DESTINATION INACCESSIBLE
DEST SPIDNT REASON
2-1134 D61A DEST UNREACHABLE