Don't like ads? PRO users don't see any ads ;-)

parselog.awk

By: swoop on May 2nd, 2012  |  syntax: Awk  |  size: 0.23 KB  |  hits: 61  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/usr/bin/awk -f
  2.  
  3.     {
  4.      if($7 ~ /\/datasheets\//){
  5.        file = $7
  6.        sub("/datasheets/", "", file)
  7.      ctr[file]++
  8. }
  9. }
  10.  
  11. END{for(file in ctr){ name = file sub(/\....$/,"",name); print name, file, ctr[file]}}