Search Results

Search: Posts Made By: Shirisha
3,398
Posted By kurumi
$ ruby -ne...
$ ruby -ne 'BEGIN{h={};h.default=0};(a=$_.scan(/^.*logs\/(.[^\/]*)(.[^:]*)/).join; h[a]+=1) \
if /ERROR|INFO/;END{h.each{|x,y| print "#{x} Exception caught #{y}\n" } } ' file
3,398
Posted By danmero
awk -F':|\] '...
awk -F':|\] ' '/ERROR|INFO/{sub(".*logs/","",$1);a[$1 OFS $NF]++}END{for(i in a)print i,a[i]}' file
3,398
Posted By Franklin52
Another approach: awk...
Another approach:
awk '/ERROR|INFO/{sub(".*logs/","");sub(":.*","");a[$0]++}
END{for (i in a)print i, "Exception is caught", a[i]}' file
3,398
Posted By bartus11
Try: perl -ne...
Try: perl -ne '/(?<=logs\/)([^\/0-9]+).*?\/([^:]+).*(?<=] )(.*?)$/;$a{"$1*/$2,$3"}++;END{for $i (keys %a){print "$i, $a{$i}\n"}}' logfile
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 06:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy