awk显示ping的时间 ping 127.0.0.1 | awk '{ print $0"\t" strftime("%Y-%m-%d %H:%M:%S",systime()) }' 注释: \t //换行字符 $0 //打印整行 {print $0 "\t"} //逐行打印 strftime()//时间函数。一般配合系统时间函数systime()使用 strftime("%Y-%m-%d %H:%M:%S",systime()) //打印系统时间

busybox [root@master1 ~]#docker service create --name busybox3 --replicas=3 busybox ping baidu.com [root@master1 ~]# docker service logs busybox3 -f -t