#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Grep options for a time stamp ?


    Hello

    How to grep on AIX , with required timestamp slot, that is


    For example:

    System went down , say at Dec 2 01.50

    Now after coming to office in the Buisiness hours of 3 December

    I want to view the Files and the text which has given the details , what has

    happened on the system in at Dec 01.50

    how to grep the file names with Time stamp and text

    I tried with

    #grep -i Dec 2 01.50 * | more

    But I get output like

    dev_id[Thr 1] Mon Dec 3 07:28:58 2012
    dev_id[Thr 1] Mon Dec 3 07:28:59 2012
    dev_id[Thr 772] Mon Dec 3 07:29:03 2012
    dev_id[Thr 772] Mon Dec 3 07:29:14 2012
    dev_idb00:started at : Sun Dec 2 22:19:57 2012
    dev_idb00:[Thr 1] Sun Dec 2 22:19:57 2012
    dev_idb00:[Thr 1] Sun Dec 2 22:19:58 2012
    dev_idb00:[Thr 772] Sun Dec 2 22:19:59 2012
    dev_idb00:[Thr 772] Sun Dec 2 22:20:02 2012
    dev_idb00:[Thr 772] Sun Dec 2 22:20:11 2012
    dev_idb01:started at : Sat Dec 1 14:51:10 2012
    dev_idb01:[Thr 1] Sat Dec 1 14:51:10 2012
    dev_idb01:[Thr 1] Sat Dec 1 14:51:11 2012
    dev_idb01:[Thr 772] Sat Dec 1 14:51:14 2012
    dev_idb01:[Thr 772] Sat Dec 1 14:51:19 2012

    Regards
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,442
    Rep Power
    1688
    Try:

    Code:
    grep "Dec 2 " * | more
    That will give you all the entries for that day. If you want to cut that down to just on or after that specific time I'd be more inclined to just pipe the output at a file and edit out the earlier entries.
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc

IMN logo majestic logo threadwatch logo seochat tools logo