awk分析Nginx日志中的cookie
整到凌晨1点半,没白忙活
awk -F \` '{if ($14!=""&&$14!="-"){ split($14, arr, ";") for (i in arr){ if (!arr[i]) continue s = arr[i] gsub(/[[:blank:]]*/,"",s) l = index(s,"=") if (l == 0) continue printf("%s %s\n", $13,substr(s, 0, l - 1)) } }}'