久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      GoAccess 分析 Nginx 日志

      0x00 事件

      幫助朋友搭建了博客,運(yùn)行過了一段時(shí)間,準(zhǔn)備發(fā)個(gè)網(wǎng)站分析報(bào)告給他。
      有效的數(shù)據(jù)只有 Nginx 的訪問日志,于是使用決定 GoAccess 工具對(duì)這個(gè)日志進(jìn)行分析,

      0x01 安裝

      吾使用的是 CentOS,使用 yum 源進(jìn)行安裝即可。

      $ yum -y install goaccess

      其他平臺(tái)可參考官方下載:https://goaccess.io/download

      0x02 使用

      1、確定日志格式
      從 Nginx 的配置中可以查看日志文件的格式:

       log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';

      日志文件內(nèi)容:

      223.104.189.167 - - [07/Aug/2019:03:03:02 +0000] "GET /favicon.ico HTTP/1.1" 200 5 "https://www.example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36"

      2、使用命令并加上格式化參數(shù)

      $ goaccess -f access.log --log-format='%h %^ %^[%d:%t +0000] "%r" %s  %b "%R" "%u"' --date-format='%d/%b/%Y' --time-format='%H:%M:%S'  -d -a > test.html $ ls  access.log test.html

      參數(shù)說明:

      -f   指定輸入日志文件的路徑。  --log-format   指定日志格式字符串。  --date-format   日志格式日期。它們都以百分號(hào)(%)開頭。  --time-format   日志格式時(shí)間。它們都以百分比(%)開頭。  -a   按主機(jī)啟用用戶代理列表。  -d   在HTML或JSON輸出上啟用IP解析器。

      格式化參數(shù)主要為日志格式化 –log-format、日期格式化 –date-format 和時(shí)間格式化–time-format 。
      在 https://goaccess.io/man#custom-log 可以查找 %* 對(duì)應(yīng)的說明符。

      3、查看分析文件

      最后在瀏覽器中打開 test.html 文件,就能看到訪問日志的具體分析:

      GoAccess 分析 Nginx 日志

      GoAccess 分析 Nginx 日志

      贊(0)
      分享到: 更多 (0)
      ?
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)