nitter
Hal Pomeranz
@hal_pomeranz
3 May 2021
You can do it without the loop. Assign your timestring back into $1 and set $2='' (nullstring). Then just "print" will dump the entire revised line.
1
1
Hal Pomeranz
@hal_pomeranz
3 May 2021
But honestly I might use a shell loop for this instead of awk.
1
Hal Pomeranz
@hal_pomeranz
4 May 2021
cat access.log | while read time rest; do echo $(date -d @$time "+%FT%T")$(echo
$time
| sed 's/^[0-9]*//')Z
$rest
; done
May 4, 2021 · 2:00 PM UTC
1