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))
    }
}}'

 

posted @ 2013-05-31 01:26  aboys  阅读(154)  评论(0编辑  收藏  举报