I have a log file which has first few characters of every line as a timestamp.
2010-06-01 04:56:02,802 DEBUG {Thread-27} Some text message
2010-06-01 04:56:02,802 DEBUG {Thread-27} Some text message
2010-06-01 04:56:02,802 DEBUG {Thread-27} Some text message
2010-06-01 04:56:02,802 DEBUG {Thread-27} Some text message
2010-06-01 05:22:02,802 DEBUG {Thread-27} Some text message
2010-06-01 05:22:02,802 DEBUG {Thread-27} Some text message
2010-06-01 05:22:02,802 DEBUG {Thread-27} Some text message
2010-06-01 05:22:02,802 DEBUG {Thread-27} Some text message
2010-06-01 06:43:02,802 INFO {Thread-27} Some text message
2010-06-01 06:43:02,803 INFO {Thread-27} Some text message
2010-06-01 06:43:02,804 INFO {Thread-27} Some text message
2010-06-01 06:43:02,804 INFO {Thread-27} Some text message
2010-06-01 06:43:02,809 DEBUG {Thread-27} Some text message
2010-06-01 06:43:02,809 DEBUG {Thread-27} Some text message
2010-06-01 06:43:02,809 DEBUG {Thread-27} Some text message
2010-06-01 07:08:02,809 DEBUG {Thread-27} Some text message
2010-06-01 07:08:02,809 DEBUG {Thread-27} Some text message
My aim to find all such lines which have the timestamp of 1 hr before the current time.
Nitin--Bld-17:~ nitin$ uname -a
Darwin Nitin--Bld-17.local 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31 22:52:17 PDT 2009; root:xnu-1228.12.14~1/RELEASE_I386 i386
Nitin--Bld-17:~ nitin$
if the above command is not executing successfully, then my script will not work. then you have to write a seperate logic to find out the one hour less time