Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

convert log file with unix timestamp

awk -F"[][]" '{cmd="date -d@" $2;cmd |getline $2; close(cmd)}1' infile

" Thu Oct 19 03:42:35 STD 2017  Auto-save of retention data completed successfully.",
" Thu Oct 19 04:42:35 STD 2017  Auto-save of retention data completed successfully.",
" Thu Oct 19 05:42:35 STD 2017  Auto-save of retention data completed successfully.",
" Thu Oct 19 06:42:35 STD 2017  Auto-save of retention data completed successfully.",
" Thu Oct 19 07:42:35 STD 2017  Auto-save of retention data completed successfully."
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #convert #log #file #unix #timestamp
ADD COMMENT
Topic
Name
5+6 =