<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ## **對日志文件的IP出現的次數進行統計,并顯示次數最多的前5名** ### **Nginx日志格式如下所示:** ``` log_format main '$remote_addr - $remote_user [$time_local] ' 'fwf[$http_x_forwarded_for] ' '$http_host $request ' '$status $upstream_response_time $request_time ' '$request_length ' '$body_bytes_sent $http_referer ' '$http_user_agent $server_addr $http_x_real_ip'; ``` ### **日志內容示例如下:** ``` 47.112.193.218 - - [21/Jan/2021:00:51:55 +0800] fwf[-] txw-api.dhclgl.com GET / HTTP/1.1 200 0.002 0.003 149 31 - python-requests/2.20.1 192.168.1.15 - 47.112.193.218 - - [21/Jan/2021:03:35:57 +0800] fwf[-] txw-api-pro.dhclgl.com GET / HTTP/1.1 200 0.002 0.003 153 32 - python-requests/2.20.1 192.168.1.15 - 47.112.193.218 - - [21/Jan/2021:04:55:16 +0800] fwf[-] txw-api.dhclgl.com GET / HTTP/1.1 200 0.004 0.003 149 31 - python-requests/2.20.1 192.168.1.15 - 47.112.193.218 - - [21/Jan/2021:07:37:25 +0800] fwf[-] txw-api-pro.dhclgl.com GET / HTTP/1.1 200 0.003 0.003 153 32 - python-requests/2.20.1 192.168.1.15 - 47.112.193.218 - - [21/Jan/2021:08:51:27 +0800] fwf[-] txw-api.dhclgl.com GET / HTTP/1.1 200 0.002 0.002 149 31 - python-requests/2.20.1 192.168.1.15 - 47.112.193.218 - - [21/Jan/2021:11:36:00 +0800] fwf[-] txw-api-pro.dhclgl.com GET / HTTP/1.1 200 0.003 0.003 153 32 - python-requests/2.20.1 192.168.1.15 - ``` ### **awk處理如下:** ``` awk '{print $1}' test.log | uniq -c | sort -nr | head -5 ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看