zoukankan      html  css  js  c++  java
  • nginx-日志统计

    #!/bin/bash

    fd=/tmp/log
    # pv 点击量
    echo "###################点击量 --$pv-- #########################" >> ${fd}tongji.txt
    pv=`cat ${fd}a.log | wc -l`
    echo "*************************************************************************************" >> ${fd}tongji.txt
    #ip
    echo "###################IP访问量 --$pv-- #########################" >> ${fd}tongji.txt
    ip=`cat a.log |awk '{print $1}'|sort -k1 -r |uniq -c |sort -n -k1 -r|head -10`
    echo $ip >> ${fd}tongji.txt
    echo "*************************************************************************************" >> ${fd}tongji.txt
    # 请求时间、url、耗时,前10名
    echo "###################请求时间、url、耗时,前10名 #########################" >> ${fd}tongji.txt
    #`cat ${fd}a.log | awk '{print $4,$7,$NF}' | awk -F '"' '{print $1,$2,$3}' | sort -k3 -rn | head -10` >> ${fd}tongji.txt
    top=`cat a.log | awk '{print $4,$7,$NF}'| awk -F '"' '{print $1,$2,$3}'| sort -k3 -rn |grep -vE 'timed|jpg|png|js|css|html|gif|bmp' |head -10`
    echo $top >> ${fd}tongji.txt
    echo "*************************************************************************************" >> ${fd}tongji.txt
    #echo $top10 >> ${fd}tongji.txt

  • 相关阅读:
    Node入门--事件模块
    Node入门--1--module&require
    Node入门--1-->Hello World
    文件上传(StringMVC)
    StringMVC
    Spring基础
    手动添加日期到mysql数据库
    aspectj 注解
    HandlerMapping执行过程。。。
    在考试我打
  • 原文地址:https://www.cnblogs.com/kuku0223/p/8309439.html
Copyright © 2011-2022 走看看