Gentoo Archives: gentoo-user

From: Peter Humphrey <peter@××××××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Time format in log files
Date: Tue, 29 Jan 2008 11:08:26
Message-Id: 200801291052.18907.peter@humphrey.ukfsn.org
In Reply to: Re: [gentoo-user] Time format in log files by Jan Seeger
1 On Monday 28 January 2008 16:43:29 Jan Seeger wrote:
2
3 > perl -npe '/^\[(\d+)\]/; @times = localtime $1; $times[4]++;
4 > $times[5]+=1900; s/\[\d+\]/$times[2]:$times[1]
5 > $times[3].$times[4].$times[5]/;'
6 >
7 > Just pipe your log through that and you will get beautiful (european)
8 > dates instead of timestamps.
9
10 > use perl or die()^^.
11
12 s/or/and/ :-)
13
14 > I got it using the following jumbled one-liner:
15
16 Nope. I pasted that into a file called pipe, and it still returns Unix time
17 stamps, thus:
18
19 $ grep completed /var/log/emerge.log | tail | ./pipe
20 1201599475: ::: completed emerge (1 of 86) kde-base/arts-3.5.8 to /
21 ...
22
23 Next? :-)
24
25 --
26 Rgds
27 Peter
28 --
29 gentoo-user@l.g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Time format in log files Jan Seeger <jan.seeger@×××××××××.de>