Hi I am new to shell script. I am trying to extract the specific value from the log.
When I filter the data by using specific keyword. It looks like these.
cat hive-server2.log | grep user
The output of the data is
2018-01-18T16:20:39,464 WARN [67272380-f3e9-40da-8e8e-a209c05eb4fe HiveServer2-Handler-Pool: Thread-37([])]: util.CurrentUserGroupInformation (CurrentUserGroupInformation.java:getGroupNameFromUser(52)) - user a8197zz (auth:PROXY) via hive (auth:SIMPLE) has no primary groupName, setting groupName to be a8197zz.
In the above data I want to extract the specific value for the user like this.
a8197zz
I tried like this.
awk 'BEGIN{ print "User" }
/\<user\>/{ u=$10 }
//{ print u }' OFS=',' hive-server2.log
It prints blank lines only. Any help will be appreciated.