Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cat|cut|cut|sort|uniq|sort > file

 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So it turns out running this on 24Gb takes a while.

Who knew?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually I've been running the following on the combined log files for the month from 100 client sites. Personally I think the problem is too much logging.

cat *.log* |cut -d' ' -f7|cut -d'?' -f1|sort |uniq -c|sort -n>file.count
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ho hum.

I was hoping to have a look at the results, but I might go to bed.
 
Doug Slattery
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe this will save you a second or two . (Warning, I didn't test it, but I think you get the idea...)

sed -e 's/^\([^ ]* \)\{6\}\([^?]*\)?/\2/' < *.log* > reallybig.log; sort -n reallybig.log | uniq -c > file.count

Aloha,
Doug

-- Nothing is impossible if I'mPossible
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When N is big, even N ln(N) is big
 
Doug Slattery
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, but at least now, it's not 2N

Aloha,
Doug

-- Nothing is impossible if I'mPossible
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
keeping in mind we're in MD and not Linux, I'll just say "One day I need to look at sed"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic