-
-
Save unabridgedxcrpt/a274776b636f5a555ed5cea8f4ea3427 to your computer and use it in GitHub Desktop.
calculate transfer out from wowza logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To calculate the bandwidth usage per session, subtract sc-bytes in the “connect” event by sc-bytes in the “disconnect” event | |
connect=`grep $'\tconnect' wowzastreamingengine_access.log.????-??-?? | cut -f22 | awk '{total = total + $1}END{print total}' ` | |
disconnect=`grep $'\tdisconnect' wowzastreamingengine_access.log.????-??-?? | cut -f22 | awk '{total = total + $1}END{print total}' ` | |
SESSION=`expr $connect - $disconnect` | |
echo -e "Bandwidth usage per session, subtract sc-bytes in the *connect* event by sc-bytes in the *disconnect* event\n" | |
echo -e " $SESSION bytes" | |
# 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' wowzastreamingengine_access.log.????-??-?? | cut -f27 | awk '{total = total + $1}END{print total}' ` | |
stops=`grep $'\tstop' wowzastreamingengine_access.log.????-??-?? | cut -f27 | awk '{total = total + $1}END{print total}' ` | |
PERSTREAM=`expr $stops - $play` | |
echo -e "Bandwidth usage per stream, subtract sc-stream-bytes in the *play* event from sc-stream-bytes in the *stop* event.\n" | |
echo " $PERSTREAM bytes" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment