Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to count the number of SQL queries per second from a log file and I want to do it in real time by pipeing stdout from grep into some command. ( I am doing some performance testing )

I could write it myself, but thought for sure this would exist.

I looked at wc but didn't see an option to allow this.

I could also use it to count requests per second by piping a tail from the access log.

share|improve this question
1  
    
I am looking for something more generally useful that what that question refers to. –  digidigo Jan 31 '13 at 17:05
add comment

2 Answers

up vote 6 down vote accepted

Maybe you should try logtop ?

tail -f foobar.log |logtop
share|improve this answer
    
Is this the log top you are referring to? github.com/JulienPalard/logtop –  digidigo Jan 31 '13 at 17:03
    
Yes, if you are using debian there is a package in repository packages.debian.org/wheezy/logtop –  klocek Jan 31 '13 at 21:45
    
dang I think this is what I need but I couldn't get it to compile on CentOs –  digidigo Feb 2 '13 at 4:07
add comment
watch -n 5 "mysqladmin status | awk -F'  ' '{ print \$NF }'"
share|improve this answer
    
I couldn't get this to work. You sure about the syntax? –  digidigo Jan 31 '13 at 17:04
    
Which error do you get? Have you configured ~/.my.cnf to run mysqladmin without prompting for password? –  quanta Feb 1 '13 at 0:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.