Hi all I am a bit new to grep etc.I did read the man page and searched internet before asking the question here.I am having a server which is running behind chain of reverse proxy servers.An application is giving me problem and I have to analyze the header response all those servers are accessible on SSH consoles so I decided to read Apache logs my problem is I want to have a script which can read the required part of logs from Apache and tell me exact thing.I have to do this on many places so the job becomes difficult. Here is a sample log I have
192.168.1.1 - - [18/Nov/2010:15:24:53 +0530] "GET /appl/pix/i/restore.gif HTTP/1.1" 304 187 "http://somedomain/appl/course/view.php?id=2" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.2)"
192.168.1.1 - - [18/Nov/2010:15:24:53 +0530] "GET /appl/pix/i/group.gif HTTP/1.1" 304 187 "http://somedomain/appl/course/view.php?id=2" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.2)"
192.168.1.1 - - [18/Nov/2010:15:24:53 +0530] "GET /appl/pix/i/return.gif HTTP/1.1" 304 188 "http://somedomain/appl/course/view.php?id=2" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.2)"
192.168.1.1 - - [18/Nov/2010:15:24:53 +0530] "GET /appl/pix/i/stats.gif HTTP/1.1" 304 187 "http://somedomain/appl/course/view.php?id=2" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.2)"
192.168.1.1 - - [18/Nov/2010:15:24:53 +0530] "GET /appl/pix/i/questions.gif HTTP/1.1" 304 187 "http://somedomain/appl/course/view.php?id=2" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.2)"
192.168.1.1 - - [18/Nov/2010:15:24:53 +0530] "GET /appl/pix/i/files.gif HTTP/1.1" 304 187 "http://somedomain/appl/course/view.php?id=2" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.2)"
192.168.1.1 - - [18/Nov/2010:15:24:53 +0530] "GET /appl/pix/i/user.gif HTTP/1.1" 304 187 "http://somedomain/appl/course/view.php?id=2" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.2)"
192.168.1.1 - - [18/Nov/2010:15:24:53 +0530] "GET /appl/pix/i/course.gif HTTP/1.1" 304 187 "http://somedomain/appl/course/view.php?id=2" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.2)"
192.168.1.1 - - [18/Nov/2010:15:24:53 +0530] "GET /appl/pix/t/groupn.gif HTTP/1.1" 304 187 "http://somedomain/appl/course/view.php?id=2" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.2)"
I want to have some thing can take relevant lines from log on the basis of date:time so how do I do a grep on that does any one have any simple suggestion in this situation,the log files are pretty big and I need to get only those responses based on time stamps (which can be ranges from users) which gave errors.