概述
Rhit 可以从标准文件夹中读取 Nginx 的日志文件(gzipped 的压缩文件也可以),并进行分析统计,在控制台中以可视化的表格形式展示,并且不会产生任何多余的临时文件或数据。
可以按照日期、响应值、请求来源等进行过滤匹配,并进行分析,Rhit 具有很高的效率,每秒可以处理百万行日志数据。
工具介绍
1 | https://dystroy.org/rhit/ |
项目地址
1 | https://github.com/Canop/rhit |
下载地址
1 | https://dystroy.org/rhit/download/ |
安装
环境
CentOS Linux 7 (Core)
1、下载
1 | wget https://dystroy.org/rhit/download/rhit_1.4.1.zip |

2、解压
1 | unzip -o rhit_1.4.1.zip -d rhit/ |

3、切换目录

4、获取帮助文档
1 | ./rhit --help |

使用
显示指定字段
工具会自动提取nginx存放日志的目录文件,也可指定存放目录。
1 | [root@si1ent x86_64-unknown-linux-musl]# ./rhit ./access.log-20210308.gz |
如下提取默认保存目录
1 | [root@si1ent x86_64-unknown-linux-musl]# ./rhit |
参数
1 | --color 默认是auto,可设置yes、或no来颜色区分. |
显示每日请求
1 | [root@si1ent x86_64-unknown-linux-musl]# ./rhit -f date |

显示IP
1 | [root@si1ent x86_64-unknown-linux-musl]# ./rhit -f ip |

显示状态码
1 | [root@si1ent x86_64-unknown-linux-musl]# ./rhit -f status |

筛选IP
1 | [root@si1ent x86_64-unknown-linux-musl]# ./rhit -i 221.225.31.88 |

筛选日期
1 | [root@si1ent x86_64-unknown-linux-musl]# ./rhit -d 2021/03/07-2021/03/08 |

其他高级筛选
1 | [root@si1ent x86_64-unknown-linux-musl]# ./rhit -d 2021/03/07-2021/03/17 -p /tag |

说明
其他参数适用请各位大佬继续发掘并结合其他工具使用。
Referer
1 | https://github.com/Canop/rhit |
赏
使用支付宝打赏
使用微信打赏
若你觉得我的文章对你有帮助,欢迎点击上方按钮对我打赏
扫描二维码,分享此文章