#!/usr/bin/awk -f ######################################################################### # log-qmail: # # A filter which converts the time stamp on qmail log files to a human # readable form. # # Written by Alan Mackenzie , 2015-10-18. # This script is in the public domain. # # To use, pipe all or part of a log file through this filter. ######################################################################### { sec = strtonum("0x" substr($1, 10, 8)) subsec = strtonum("0x" substr($1, 18, 8)) / 1000000000 str = strftime("%Y-%m-%d %H:%M:%S%% %z", sec, 0) sub("%", substr (sprintf("%.3f", subsec), 2), str) $1 = str print }