[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

[Openvpn-users] Automatically parse and add-up byte-count from client-disconnect log - Paying Job!



Hello,

Over the last two months I have acquired a log file that contains a line for each client-connect and each client-disconnect. The file was created with these two scripts:

[root@server openvpn]# cat client-connect
#!/bin/sh

LOGGER=/usr/bin/logger
HOSTNAME=`hostname`
SCRIPT=`basename $0`

$LOGGER -plocal3.debug -t "$HOSTNAME openvpn $SCRIPT" "${common_name}"
[root@server openvpn]# cat client-disconnect
#!/bin/sh

LOGGER=/usr/bin/logger
HOSTNAME=`hostname`
SCRIPT=`basename $0`

$LOGGER -plocal3.debug -t "$HOSTNAME openvpn $SCRIPT" ${common_name} ${bytes_sent}/${bytes_received}
[root@server openvpn]# 


Here is an example of the file created:

Jul 25 19:01:52 texas01 texas01.example.com openvpn client-connect: admin01
Jul 25 19:02:05 texas01 texas01.example.com openvpn client-disconnect: admin01 7836/7490
Jul 25 19:02:38 texas01 texas01.example.com openvpn client-connect: admin01
Jul 25 19:06:50 texas01 texas01.example.com openvpn client-disconnect: admin01 9253/7842
Jul 26 13:58:37 texas01 texas01.example.com openvpn client-connect: client_00101
Jul 26 13:59:44 texas01 texas01.example.com openvpn client-disconnect: client_00101 64105/34070
Jul 26 13:59:52 texas01 texas01.example.com openvpn client-connect: client_00101
Jul 26 14:04:33 texas01 texas01.example.com openvpn client-disconnect: client_00101 81163/46283

I would like a way to add-up the byte-count for each user, and if possible the bytes sent and the bytes received (the numbers are separated by a "/" in the log) for each user. I have Windows, Linux, and Mac, so a solution for any platform is acceptable. If there is already something I can use, let me know. Otherwise, I am willing to pay for a simple script to do this for me.


Thanks!