shell linux日志分析脚本
最近访问ftp所在的服务器时反应有点慢,于是想看看ftp是否有被爬虫爬过,然后随手写了一个简易版的日志分析工具,用来分析每日用户的来源地址及访问量。由于没有做日志切割,此脚本只是在访问日志中统计前一日的数据,想要统计更多的数据可以稍作修改。#!/bin/bash
cat$Tmpfile
cat $Tmpfile | while read line;
do
num=$(echo $line|awk '{print $1}')
echo -n "访问次数:$num "
ip=$(echo $line|awk '{print $2}')
curl -s ip.cn?ip=$ip
done
执行结果如下所示:
页:
[1]