./hqe.py --help
usage: hqe.py [-h] [--since SINCE] [--to TO] [--logdir LOGDIR]
[--glob LOGFILE_GLOB]
[--loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
Displays queries ran on Hive.
optional arguments:
-h, --help show this help message and exit
--since SINCE how far to look back. (default: 15m)
--to TO How far to look forward. (default: now)
--logdir LOGDIR Directory of hive log files. (default: /var/log/hive)
--glob LOGFILE_GLOB Shell pattern of hive logfiles inside their logdir.
(default: hiveserver2.log*)
--loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}, -l {DEBUG,INFO,WARNING,ERROR,CRITICAL}
Log level. (default: warn)
1条答案
按热度按时间ql3eal8s1#
我在python中发现了一个脚本,可以用user提取所有sql命令,您可以扩展该脚本。
如果知道显示了user、hostname和duration,则显示的查询格式与发送的格式相同,包括注解,
博客帖子:https://thisdataguy.com/2017/06/23/extracting-queries-from-hive-logs/
github项目