I have a large text file with logs. After I execute the below awk command, I'm getting below output
grep TEST-FIELD test.log | awk '{print $23,$24,$4,$6,$7,$11,$12,$13}'
2020/01/12 08:43:14 TEST-FIELD 10001000 RRRT100 xx.xx.xx.xx [xx-xxxx] xx.xx.xx.xx
2020/01/12 08:43:14 TEST-FIELD 10001000 RRRT100 xx.xx.xx.xx [xx-xxxx] xx.xx.xx.xx
2020/01/12 08:43:14 TEST-FIELD 10001000 RRRT100 xx.xx.xx.xx [xx-xxxx] xx.xx.xx.xx
2020/01/12 08:43:14 TEST-FIELD 10001000 RRRT100 xx.xx.xx.xx [xx-xxxx] xx.xx.xx.xx
I need to change the output of the date column ($23) to like this
2020-01-12 08:43:14 TEST-FIELD 10001000 RRRT100 xx.xx.xx.xx [xx-xxxx] xx.xx.xx.xx
2020-01-12 08:43:14 TEST-FIELD 10001000 RRRT100 xx.xx.xx.xx [xx-xxxx] xx.xx.xx.xx
2020-01-12 08:43:14 TEST-FIELD 10001000 RRRT100 xx.xx.xx.xx [xx-xxxx] xx.xx.xx.xx
2020-01-12 08:43:14 TEST-FIELD 10001000 RRRT100 xx.xx.xx.xx [xx-xxxx] xx.xx.xx.xx
I tried to below command but it not printing proper values at all
grep TEST-FIELD test.log | awk -F"/" '{OFS="/"; $23=strftime("%Y-%m-%d", $23); print $24,$4,$6,$7,$11,$12,$13}'
How can I get the correct output only using AWK