1.统计每分钟内 url 的访问数量 SELECT SUBSTRING(CONVERT(varchar(100), date, 20), 0,17) as dateTime,COUNT(url) as count,url,referer FROM demo GROUP BY url,(SUBSTRING(CONVERT(varchar(100), date, 20), 0,17) ),referer;…
#!/usr/bin/python #-*- coding: utf- -*- import os import re rawfile = '/var/log/auth.log' def rawparse(rawfile): ipdict = {} fhandle = open(rawfile,'r') regexp = re.compile('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}') for line in fhandle: result = regexp.fi…
#!bin/bash#作者:liusingbon#功能:统计 Linux 进程相关数量信息,running(运行的进程),sleeping(睡眠中的进程),stoped(停止的进程),zombie(僵尸进程)running=0sleeping=0stoped=0zombie=0#在 proc 目录下所有以数字开始的都是当前计算机正在运行的进程的进程 PID#每个PID编号的目录下记录有该进程相关的信息for pid in /proc/[1-9]*doprocs=$[procs+1]stat=$(…