Search squid archive

perl script for translating log times

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

if anyone is interested in translating log timestamps, here it is:

perl -pe 's/(\d+\.\d+)(\s+)(\d+)/localtime($1-$3\/1000)." - ".localtime($1)/e'


This translates log timestamps from:

1567673687.237 1737748

e.g. date of end, time in microseconds into format of:

date of start - date of end

e.g. from:

1567673687.237 1737748 192.168.X.Y TCP_TUNNEL/200 2758742 CONNECT A.B.C.D:8089 - HIER_DIRECT/A.B.C.D -

to:

Thu Sep  5 10:25:49 2019 - Thu Sep  5 10:54:47 2019 192.168.X.Y TCP_TUNNEL/200 2758742 CONNECT A.B.C.D:8089 - HIER_DIRECT/A.B.C.D -

in local time.

--
Matus UHLAR - fantomas, uhlar@xxxxxxxxxxx ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Fighting for peace is like fucking for virginity...
_______________________________________________
squid-users mailing list
squid-users@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users




[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux