Timestamp Search


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Timestamp Search
# 1  
Old 08-05-2008
Timestamp Search

Hi,

I am trying to write a script which would go search and get the info from the logs based on START and END timestamps. The log file format is as follows

255.45.250.227 - Unauth [05/Aug/2008:20:45:05 -0400] "GET HTTPS://relia.stage.tata.com/include...Javascript.jsp HTTP/2.2" 200 46850
255.45.250.227 - Unauth [05/Aug/2008:20:48:05 -0400] "GET HTTPS://relia.stage.tata.com/un/js/browsercheck.js HTTP/2.2" 504 0
244.258.27.225 - airtel1@tata.net [05/Aug/2008:20:50:05 -0400] "GET HTTPS://test-Sky.stage.tata.com/stat...m_writeHTML.js HTTP/2.2" 200 2702
255.45.250.227 - Unauth [05/Aug/2008:20:52:05 -0400] "GET HTTPS://relia.stage.tata.com/un/js/general.js HTTP/2.2" 504 0
255.45.250.227 - Unauth [05/Aug/2008:20:55:04 -0400] "GET HTTPS://relia.stage.tata.com/un/js/lsgeneralScripts.js HTTP/2.2" 504 0


echo -n "3a. Timestamp start = "
read time_st
echo -n "3b. Timestamp end = "
read time_en

----
3a. Timestamp start = 05/Aug/2008:20:45:05
3b. Timestamp end = 05/Aug/2008:20:55:04
----

The timestamp format in the logs is as follows 05/Aug/2008:20:55:04.


Thank you
# 2  
Old 08-05-2008
Data Looking like homework...

Since this post here, and
https://www.unix.com/shell-programmin...#post302221963

look VERY similar, it appears that this is homework.
That is not allowed under forum rules.

Explain if otherwise.
# 3  
Old 08-05-2008
Quote:
Originally Posted by joeyg
Since this post here, and
https://www.unix.com/shell-programmin...#post302221963

look VERY similar, it appears that this is homework.
That is not allowed under forum rules.

Explain if otherwise.
---------------------------------------------------------------------

I figured out the first two parts and this is the part I wasnt able to figure out and I apologize but would like to say this is not homework.

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep lines between last hour timestamp and current timestamp

So basically I have a log file and each line in this log file starts with a timestamp: MON DD HH:MM:SS SEP 15 07:30:01 I need to grep all the lines between last hour timestamp and current timestamp. Then these lines will be moved to a tmp file from which I will grep for particular strings. ... (1 Reply)
Discussion started by: nms
1 Replies

2. Shell Programming and Scripting

AIX : Need to convert UNIX Timestamp to normal timestamp

Hello , I am working on AIX. I have to convert Unix timestamp to normal timestamp. Below is the file. The Unix timestamp will always be preceded by EFFECTIVE_TIME as first field as shown and there could be multiple EFFECTIVE_TIME in the file : 3.txt Contents of... (6 Replies)
Discussion started by: rahul2662
6 Replies

3. Shell Programming and Scripting

To check timestamp in logfile and display lines upto 3 hours before current timestamp

Hi Friends, I have the following logfile. Currently time in india is 07/31/2014 12:33:34 and i have the following content in logfile. I want to display only those entries which contain string 'Exception' within last 3 hours. In this case, it would be the last line only I can get the... (12 Replies)
Discussion started by: srkmish
12 Replies

4. Shell Programming and Scripting

Search a file for "ORA-" with timestamp

Hi Team, An application logfile is exists. From that logfile have to search for ORA- errors. Have to search with time bases. Please help me how to search a file with timestamp. Regards, Indu (6 Replies)
Discussion started by: indira_s
6 Replies

5. Shell Programming and Scripting

Search for latest Timestamp in file

Hi, I have a file which generate Timestamp in this format :- 20121012162354 20121114191610 20121210232808 20121216220002 20130106220002 20130127220001 20130203220001 20121012162354 20121114191610 20121210232808 20121216220002 20130106220002 20130127220001 20130203220001 (2 Replies)
Discussion started by: netdbaind
2 Replies

6. UNIX for Dummies Questions & Answers

How to compare a file by its timestamp and store in a different location whenever timestamp changes?

Hi All, I am new to unix programming. I am trying for a requirement and the requirement goes like this..... I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
Discussion started by: mailsara
2 Replies

7. Shell Programming and Scripting

Getting a relative timestamp from timestamp stored in a file

Hi, I've a file in the following format 1999-APR-8 17:31:06 1500 3 45 1999-APR-8 17:31:15 1500 3 45 1999-APR-8 17:31:25 1500 3 45 1999-APR-8 17:31:30 1500 3 45 1999-APR-8 17:31:55 1500 3 45 1999-APR-8 17:32:06 1500 3 ... (1 Reply)
Discussion started by: vaibhavkorde
1 Replies

8. Shell Programming and Scripting

Shell Script to Search for a particular String and copy the timestamp to a variable

Hi, We Perfrom Loads to the database through a Perl script which generates a statistics file. I need to read the statistics. the Statistics file looks something like below: Process Beginning - 08-26-2010-23.41.47 DB2 CONNECTION SUCCESSFUL! Ready to process and load file: FILENAME # of... (2 Replies)
Discussion started by: Praveenkulkarni
2 Replies

9. Shell Programming and Scripting

How to search backwards in a log file by timestamp of entries?

Hello. I'm not nearly good enough with awk/perl to create the logfile scraping script that my boss is insisting we need immediately. Here is a brief 3-line excerpt from the access.log file in question (actual URL domain changed to 'aaa.com'): 209.253.130.36 - - "GET... (2 Replies)
Discussion started by: kevinmccallum
2 Replies

10. UNIX for Dummies Questions & Answers

Using find command for timestamp based search

Hi, I am writing a script where i need to list all the files that have a scecific timestamp. I get this time stamp from another file. Is it possible to do this with 'find' command? Please let me know your valuable inputs. Thanks Sunny. (1 Reply)
Discussion started by: sunny_03
1 Replies
Login or Register to Ask a Question