awk指定[]为分隔符

root@standby[16:38:35]$
root@standby[16:38:35]$ cat tmp.log
qq [8.8.8.8] 6.6.6.6 [1502301436.016] "GET / HTTP/1.1" 200 21 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36" "-" "0.059"
qq [9.9.9.9] 6.6.6.6 [1502387868.069] "GET / HTTP/1.1" 200 21 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36" "-" "0.059"
qq [2.2.2.2] 6.6.6.6 [1502474196.260] "GET / HTTP/1.1" 200 21 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36" "-" "0.059"
root@standby[16:38:41]$
root@standby[16:38:42]$ awk -F "[][]" '{print $2"\t"$3"\t"$4}' tmp.log
8.8.8.8 6.6.6.6 1502301436.016
9.9.9.9 6.6.6.6 1502387868.069
2.2.2.2 6.6.6.6 1502474196.260
root@standby[16:38:43]$

  

上一篇:linux ----虚拟机无法与本地机通信


下一篇:.NET常用的扩展方法整理