This PHP script, from the Apache access log, you can aggregate the network transfer amount for each file type.
##Requirements Format of the access log must be combinedio.
https://httpd.apache.org/docs/2.4/en/mod/mod_logio.html
combinedio log format
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
CustomLog logs/access_log combinediophp ApacheTrafficMeasurement.php /var/log/httpd/access_log