LoginSignup
18
18

More than 5 years have passed since last update.

WEBサーバのログからアクセス数順にIPアドレスを抜き出すワンライナー

Posted at
$ cat /opt/nginx/logs/access.log | awk '{print $1}' | sort | uniq -c | sort -nr
1900401 10.21.11.21
  64325 10.21.62.40
  11434 101.155.17.53
    518 101.155.17.78
    264 101.155.25.53
     96 101.155.33.170
     24 102.10.123.55
     16 102.10.157.178
     15 102.11.138.100
      3 107.11.125.51
      1 107.11.125.50

アドレスは適当に変えてる。

18
18
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
18