I have a log file that I need help parsing
This is what it looks like:
2018-02-19 15:55:50.070 t.a.ApiUploader [INFO] zzz(708473232) uploaded file 'hdfs://fr-de.int.fz.net:4010/user/profile_export/aId=6/empId=4/classId=10/members-x--491eedd6-2e14-488f-8c13-84be2c6f777b.txt.gz' in 4 chunk(s) - total ops: 31, failed ops: 0
2018-02-19 15:55:50.092 t.a.ApiUploader [INFO] zzz(617022301) uploaded file 'hdfs://fr-de.int.fz.net:4010/user/profile_export/aId=6/empId=4/classId=10/members-x-de10af80-4ac5-4b1a-9675-f7aa9da7ecb2.txt.gz' in 5 chunk(s) - total ops: 45, failed ops: 0
2018-02-19 15:55:50.204 t.a.ApiUploader [INFO] zzz(89993157) uploaded file 'hdfs://fr-de.int.fz.net:4010/user/profile_export/aId=6/empId=4/classId=10/members-x-2aa7808e-a209-4bf8-a744-818724cca054.txt.gz' in 4 chunk(s) - total ops: 32, failed ops: 0
Now what am trying to do is put results of my parsing in an excel file like:
Expected Output:
Date,aId,classId,total ops,failed ops
2018-02-19 15:55:50.070,6,10,31,0
2018-02-19 15:55:50.092,6,10,45,0
2018-02-19 15:55:50.204,6,10,32,0
I can get it separately but how can I combine all into comma separated format? Is there a bash sample to do this?
cat twr.log | awk -F" " {'print $8'} | awk -F"/" {'print $8, $10'}
This gave me:
aId=6 classId=10
aId=6 classId=10
aId=6 classId=10
For date I did this:
cat twr.log | awk -F" " {'print "Date: " $1,$2'}
Date: 2018-04-19 15:55:50.070
Date: 2018-04-19 15:55:50.092
Date: 2018-04-19 15:55:50.204
Any help is appreciated.
Thanks