07:46:24,059 DEBUG [com.ibm.cmps.portal.web.account.tree.RelationshipRetriever] (http-nykdsr9622/10.54.65.111:4150-3) Fund count: 14
07:46:28,378 DEBUG [com.ibm.cmps.extgrid.grid.StaticHtmlControl] (http-nykcsr5422/10.54.65.111:4150-3) rowCount:75 - displayThreshold:75
07:46:28,384 INFO [com.ibm.cmps.extgrid.xml.TreeGridV6XmlGenerator] (http-nykdsr9622/10.54.65.111:4150-3) Finished layout rendering in 9 ms
Format of Log file is as above. I would like to print only JavaClass Name and Message Log. For example from above text, I need below data to be extracted.
[com.ibm.cmps.portal.web.account.tree.RelationshipRetriever] Fund count: 14
[com.ibm.cmps.extgrid.grid.StaticHtmlControl] rowCount:75 - displayThreshold:75
[com.ibm.cmps.extgrid.xml.TreeGridV6XmlGenerator] Finished layout rendering in 9 ms
I wish to print I am using awk command to get that. Below are words separated by awk..
$1=07:46:24,059
$2=DEBUG
$3=[com.ibm.cmps.portal.web.account.tree.RelationshipRetriever]
$4=(http-nykdsr9622/10.54.65.111:4150-3)
$5,$6,.. remaining Log message
As number of words after $4 are not fixed, I wish to print$3 and all words after $5
I tried using below commands-
awk '{print $3, $5;}' jboss.log
awk '{print $3, $5,$6;}' jboss.log
I wish to take all words after $4.
Does awk allows to do that?
I would appreciated usage of any other commands as well.