21 | | Here we set a shell command date -d@$2 to a variable called cmd. Then with cmd |getline $2 the awk reads a line and pass second field value to the cmd we open it, then we need close the command we opened via pipe, so we used close(cmd) |
| 21 | Here we set a shell command date -d@$2 to a variable called cmd. Then with cmd |getline $2 the awk reads a line and pass second field value to the cmd we open it, then we need close the command we opened via pipe, so we used close(cmd)[[br]] |
| 22 | Or we can used |
| 23 | {{{ |
| 24 | #!sh |
| 25 | OMD[monitor@501264b41d2d]:~/var/log$ tail naemon.log | awk -F"[][]" '{cmd="date -d@" $2;cmd |getline $2; close(cmd)}1' |
| 26 | }}} |