I am trying to parse a log file, where I would like to get the first column and the text which follows a pattern.
The log file would look like this,
2018-04-25 00:00:10,139 INFO [HiveServer2-HttpHandler-Pool: Thread-2678420]: parse.ParseDriver (ParseDriver.java:parse(185)) - Parsing command: show databases
I would like the final output which contains timestamp ( first and second column ) and all commands which is followed by keyword
Is there a clean way of getting this? Currently, my plan is to use
awk to fetch columns 1 and 2. Use
sed to get the commands and then to merge the two outputs to a new file.