How to search a file based on a time stamp backwards 10 seconds

Hi all,

I'm after some help with this small issue which i'm struggling to work out a fix for.

I have a file that contains records that all have a time stamp for each individual record, i need to search the file for a specific time stamp and then search back 10 seconds to see if the number 45768 is seen in any of the prior records.

Information
1)Event comes in on host A telling me we just received a 45768 event at 23:04:53
2)I need to search on host B if we have received any 45768 events at 23:04:53and up to 10 seconds prior to the event coming in on system A, so to 23:04:43

search string eg : 23:04:53 (All the records are in the format HH:MM:SS)

Example of file to search :

23:04:53 45768
23:04:53
23:04:52
23:04:51 45768
23:04:50
23:04:49
23:04:48 45768
23:04:47
23:04:43

Thanks in advance for any help

If you can use GNU date with POSIX shell, Python, Perl or Java it's easy enough. If not then you should write (look for, ask for) a shell function/script for parsing, changing and returning time.

Your requirements are not clear...how do you search the file using the magic no. or the timestamp and what if the very first record in the file is 45768 because you cant go backwards then. State the problem conditions clearly and you might get help...and post what you have done to work on this.