一些日志统计的命令

1,统计nginx日志红9-11点,每分钟 访问量,日志输出数量,从大到小排序 当然没有去重,但可以大致了解每分钟的并发情况:
Shell代码 收藏代码
sudo sed -n '/2015:09:00/,/2015:11:00/p' access_wcs.log | awk '{a[substr($4,9,10)]+=1} END{for(i in a) printf "%s %sn",i,a[i]}' | sort -k 2 -n -r

2,应用的日志也可以,统计,类似:
Shell代码 收藏代码
sudo sed -n '/2015-08-14 09:00:00/,/2015-08-14 11:00:00/p' wcs.log | awk -F ',' '{if($1~/2015/) a[substr($1,0,17)]+=1} END{for(i in a) printf "%s %sn",i,a[i]}' | sort -k 3 -n -r

已有 6 条评论
  1. Austot

    Legitimate Cialis Canada Everyday Viagra Dosage Cialis Online Kaufen Gunstig generic cialis canada Cheap Cialis Generic Online Viagra And Cialis Combo Pack One Dollar Viagra

    Austot 回复
  2. FranKap

    Cialis Lilly Original alli 170 count sale Propecia Success The Bald Truth Top Pills

    FranKap 回复
  3. LesSity

    Venta De Cialis En Madrid Order Doxycycline Online No Prescription Cialis Oder Levitra priligy Janssen Cilag Priligy Canadian Drug Store No Script

    LesSity 回复
  4. FranKap

    Cialis Bauchschmerzen Cialis 2 5 Mg Effetti Collaterali cialis Toronto Drug Stor Buy Viagra Online Reputable Zithromax Azithromycin Tablets

    FranKap 回复
  5. Austot

    Cephalexin Veterinarian Comprar Cialis Las Palmas viagra online pharmacy Cialis Venta Madrid Priligy Generico Precio Levitra Cheap

    Austot 回复
  6. FranKap

    Amoxicillin Horse cialis viagra habitamos Where To Purchase Diflucan

    FranKap 回复
发表新评论