Skip to content

Instantly share code, notes, and snippets.

@tingletech
Created November 1, 2012 17:58
Show Gist options
  • Save tingletech/3995384 to your computer and use it in GitHub Desktop.
Save tingletech/3995384 to your computer and use it in GitHub Desktop.
calculate transfer out from wowza logs
# To calculate the bandwidth usage per session, subtract sc-bytes in the “connect” event by sc-bytes in the “disconnect” event
connect=`grep $'\tconnect' wowzamediaserver_access.log.2012-09-?? | cut -f22 | awk '{total = total + $1}END{print total}' `
disconnect=`grep $'\tdisconnect' wowzamediaserver_access.log.2012-09-?? | cut -f22 | awk '{total = total + $1}END{print total}' `
expr $connect - $disconnect
connect=`grep $'\tconnect' wowzamediaserver_access.log.2012-??-?? | cut -f22 | awk '{total = total + $1}END{print total}' `
disconnect=`grep $'\tdisconnect' wowzamediaserver_access.log.2012-??-?? | cut -f22 | awk '{total = total + $1}END{print total}' `
expr $connect - $disconnect
# To calculate the bandwidth usage per stream, subtract sc-stream-bytes in the “play” event from sc-stream-bytes in the “stop” event.
play=`grep $'\tplay' wowzamediaserver_access.log.2012-09-?? | cut -f27 | awk '{total = total + $1}END{print total}' `
stop=`grep $'\tstop' wowzamediaserver_access.log.2012-09-?? | cut -f27 | awk '{total = total + $1}END{print total}' `
expr $stop - $play
play=`grep $'\tplay' wowzamediaserver_access.log.2012-??-?? | cut -f27 | awk '{total = total + $1}END{print total}' `
stop=`grep $'\tstop' wowzamediaserver_access.log.2012-??-?? | cut -f27 | awk '{total = total + $1}END{print total}' `
# http://help.adobe.com/en_US/FlashMediaServer/3.5_AdminGuide/WS5b3ccc516d4fbf351e63e3d119f2926bcf-79d1.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment