need help in grep

How to grep next few lines of a pattern.i.e. whenever a pattern is found the command should also returned the next 2 immediate lines below pattern.

below the lines

2008-10-14 10:32:31,046 [Thread-7] INFO - Added RegisterRead record to DB.

2008-10-14 10:35:50,343 [Thread-6] INFO - Message Subject: EMETER.ALL.DATA.METER.CLEAN

2008-10-14 10:35:50,383 [Thread-6] ERROR - CleanLPDataMessage: Missing Intervals: 62

2008-10-14 10:35:50,384 [Thread-6] INFO - LPBatch: [null, 1-SR0CU, null, DC:Tue Oct 14 15:35:50 UTC 2008, null, null, Mon Oct 13 10:45:00 CDT 2008, Mon Oct 13 15:45:00 UTC 2008,

2008-10-14 10:35:50,391 [Thread-6] INFO - Number of Intervals Not Inserted: 62 / 95

--------------------------------------------------------------------------

I m using the below command to grep a pattern :
cat Archiver* | grep '2008-10-14' | grep 'ERROR' | grep 'CleanLPDataMessage: Missing Intervals'

How to get even lines which are immediately below the grep pattern

2008-10-14 10:35:50,384 [Thread-6] INFO - LPBatch: [null, 1-SR0CU, null, DC:Tue Oct 14 15:35:50 UTC 2008, null, null, Mon Oct 13 10:45:00 CDT 2008, Mon Oct 13 15:45:00 UTC 2008,

2008-10-14 10:35:50,391 [Thread-6] INFO - Number of Intervals Not Inserted: 62 / 95

I mean to say i need a command that will give me next 2 lines immediately after the grep pattern.
when i grep ''2008-10-14' | grep 'ERROR' | grep 'CleanLPDataMessage: Missing Intervals' . it should return this as well as next 4 lines and so on till it finishes

awk '/2008-10-14/ && /ERROR/ && /CleanLPDataMessage: Missing Intervals/{c=4}c&&c--' file

Regards

thanks for your reply. can u tell me how to use this command

You can use the following command:

grep -A2 <pattern> <filename>

the below comman is not working. i m using IBm AIx 3.5

grep -A2 "ERROR - CleanLPDataMessage: Missing Intervals:" Archiver*

But below command is working :

awk '/2008-10-14/ && /ERROR/ && /CleanLPDataMessage: Missing Intervals/{c=3}c&&c--' Archiver*

Did you check if the grep command is working..?

The -A and -B options are not supported by all versions of grep.

Regards

yes -A is not supported by my version of unix