public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Jan Seeger <jan.seeger@thenybble.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Time format in log files
Date: Mon, 28 Jan 2008 17:43:29 +0100	[thread overview]
Message-ID: <20080128164329.GA9712@venus> (raw)
In-Reply-To: <200801281021.47081.peter@humphrey.ukfsn.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 28. Jan, Peter Humphrey spammed my inbox with 
> On Sunday 27 January 2008 21:54:23 Mick wrote:
> > Hi All,
> >
> > I am sure that someone has asked this before, but a cursory look doesn't
> > bring anything up.  I am going through some logs and I cannot understand
> > what the time was when certain events took place:
> >
> > [1200806556] SERVICE ALERT: router.xxxxxxxxxxxxxxxxxxxxxxx
> > [1200806576] SERVICE ALERT: router.xxxxxxxxxxxxxxxxxxxxxxx
> > [1200806891] HOST ALERT: router.xxxxxxxxxxxxxxxxxxxxxxxxxx
> > [1200806891]
> >
> > Could you please tell me how to interpret/parse these so that they show
> > time in hrs:min so that I can understand it?  (anything I could feed to
> > less would be grand).
use perl or die()^^. I got it using the following jumbled one-liner:

perl -npe '/^\[(\d+)\]/; @times = localtime $1; $times[4]++; $times[5]+=1900;
s/\[\d+\]/$times[2]:$times[1] $times[3].$times[4].$times[5]/;'

Just pipe your log through that and you will get beautiful (european) dates instead of timestamps.

Regards
Jan Seeger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)

iD8DBQFHngYwMmLQdC6jvocRAofjAKCNWtVhKGrGgukMX9LprFDt08qblgCglj40
L3DUKgZpph5DnAB6qE36tIk=
=nyK3
-----END PGP SIGNATURE-----
-- 
gentoo-user@lists.gentoo.org mailing list



  parent reply	other threads:[~2008-01-28 16:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-27 21:54 [gentoo-user] Time format in log files Mick
2008-01-27 22:14 ` Greg Bowser
2008-01-27 22:22   ` Mick
2008-01-28  9:33     ` Etaoin Shrdlu
2008-01-28 10:21 ` Peter Humphrey
2008-01-28 12:07   ` William Kenworthy
2008-01-28 14:45     ` Peter Humphrey
2008-01-28 15:15       ` Etaoin Shrdlu
2008-01-29 10:45         ` Peter Humphrey
2008-01-29 11:37           ` Etaoin Shrdlu
2008-01-29 11:40             ` Peter Humphrey
2008-01-28 16:43   ` Jan Seeger [this message]
2008-01-29 10:52     ` Peter Humphrey
2008-01-29 11:21       ` Jan Seeger
2008-01-29 11:23         ` Jan Seeger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080128164329.GA9712@venus \
    --to=jan.seeger@thenybble.de \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox