Processing apache logs quickly

前端 未结 5 443
猫巷女王i
猫巷女王i 2021-01-03 01:21

I\'m currently running an awk script to process a large (8.1GB) access-log file, and it\'s taking forever to finish. In 20 minutes, it wrote 14MB of the (1000 +- 500)MB I ex

5条回答
  •  迷失自我
    2021-01-03 01:48

    gawk '{
        dt=substr($4,2,11); 
        gsub(/\//," ",dt); 
        "date -d \""dt"\" +%s"|getline ts; 
        print $1, ts
    }' yourfile
    

提交回复
热议问题