Nick Folino wrote:
> Is there a way to change the timestamp format in the logs?
The log timestamps are printed in hex because it has the cheapest formatting
cost.
> Something a bit more readable than time from epoch in hex would be nice.
Use your favorite text processing language to postprocess the logs. perl or awk
would be easy.
This awk script will do the job:
####
/^[0-9a-f]+\.[0-9a-f]/{
split($1, stamp, ".")
ts = "0x" stamp[1] ""
us = "0x" stamp[2] ""
tsn = strtonum( ts )
usn = strtonum( us )
ns = strftime( "%Y%m%d %T", tsn ) "." usn
$1 = ns
}
{
print
}
####
awk -f stamp.awk < slapd.log | less
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/