由于ecs的nginx日志为了方便elk是输出json格式的日志,现在需要统计访问的ip。

grep -Po 'remote_addr[" :]+\K[^"]+'  /var/log/nginx/access.log  |sort | uniq -c | sort -n -k 1 -r | head -n 100

 

记下来方便自己以后使用

shell取出json格式的日志

相关文章:

  • 2022-02-26
  • 2022-12-23
  • 2021-11-19
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
猜你喜欢
  • 2021-12-17
  • 2022-12-23
  • 2021-10-04
  • 2022-12-23
  • 2021-09-09
  • 2021-12-09
相关资源
相似解决方案