Hive - find the updates done by the user

Multi tool use
Hive - find the updates done by the user
I am looking for a way to find out who ran update/drop/alter commands on Hive external table. I am not interested in select, show commands.
I couldn't find any way to figure it out. Is there any way to find it out?
If we need to do any prior work, fine as well.
Any suggestions?
@hlagos Yes. Hive meta server logs are enabled.
– Gops AB
Jun 29 at 17:25
1 Answer
1
I found a script in python that extracts all the SQL commands with user, you could extend that script.
./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)
If user, hostname and duration are know they are displayed,
query is displayed with the same formatting as it was sent, inclusive comments,
The Blog post: https://thisdataguy.com/2017/06/23/extracting-queries-from-hive-logs/
Github Project
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
are the hive logs activated and being stored?
– hlagos
Jun 28 at 16:14