【nginx】通过nginx日志统计接口访问量

2022-05-21  本文已影响0人  Bogon

传统部署方式:

$ awk -F '######' '/HTTP/ {++state[$5]} END {for(key in state) print state[key], key}'  /path/to/access.log | sort -t ' ' -k 1 -nr | head -n 100
image.png

k8s部署方式:

$ awk -F '##' '/HTTP/ {++state[$5]} END {for(key in state) print state[key], key}'  /path/to/access.log  | sort -t ' ' -k 1 -nr | head -n 100
image.png
上一篇 下一篇

猜你喜欢

热点阅读