LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   grep for date and time (https://www.linuxquestions.org/questions/red-hat-31/grep-for-date-and-time-4175559010/)

linuxew 11-16-2015 10:12 AM

grep for date and time
 
Hi all,
here is what my log files looks like:

[11/Nov/2015:06:35:00 -0500] x.59.x.x TLSv1 AES256-SHA "GET /TerminalLocationService/REST_v0_91/location?address=tel%3A%2B11506471471&accuracy=500&version=0.91 HTTP/1.1" 266 1901115
[11/Nov/2015:06:34:50 -0500] x.60.x.x TLSv1 AES256-SHA "GET /TerminalLocationService/REST_v0_91/location?address=tel%3A%2B1506471471&accuracy=500&version=0.91 HTTP/1.1" 267 12346003
[11/Nov/2015:06:35:00 -0500] x.59.x.x TLSv1 AES256-SHA "GET /TerminalLocationService/REST_v0_91/location?address=tel%3A%2B1506471471&accuracy=500&version=0.91 HTTP/1.1" 266 1881119


the file is a large file and sometimes I need to grep for specific time period, or specific time like 11/Nov/2015:19:30:00


can you please comment on combination of command I need to run.
thanks,

pan64 11-16-2015 10:22 AM

what about (for example):
grep 11.Nov.2015.15 filename

linuxew 11-16-2015 12:32 PM

Quote:

Originally Posted by pan64 (Post 5450409)
what about (for example):
grep 11.Nov.2015.15 filename

thanks,seems it is working.

can you explain me how do we know to use "." instead of what I was using "11/Nov/2015:06:35" and not reciving any thing.

pan64 11-16-2015 01:43 PM

I do not know what did you use, but:
. means simply any char (can be a letter, number or anything else).


All times are GMT -5. The time now is 08:56 AM.