HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] xferfaxlog parses



Hi Dariusz,

I've written a script in order to know how much each sender costs. This script outputs the e-mail address of the sender, whether the fax was sent abroad or stayed inside of the country, and what is the duration of the fax transmission. The output is saved to a csv file which I import in a spreadsheet and where I input the costs of the monthly bill. Hope this helps, maybe as a starting point for what you want to do.

Greetings,
Erich

#!/bin/bash

if [ $# -ne 1 ]; then
  echo "This script filters all faxes successfully sent in a given month."
  echo
  echo "Usage: $0 n"
  echo "Where n is a number between 1 and 12, for reading the log n months ago"
  exit 0
fi

echo "Sender,Destination,Duration"

(
zcat  /var/spool/hylafax/etc/xferfaxlog.$1.gz | awk -F "\t" '{
  if ($14=="\"\"") {
    if (match($8,"^\"0041")>0) {
      a="Inside"
    }
    else if (match($8,"^\"00")>0) {
      a="Abroad"
    }
    else {
      a="Inside"
    }
    print $7 "," a ",00:" $13
  }
}' 
) > monthlystats.csv


-----Original Message-----
From: hylafax-users-bounce@xxxxxxxxxxx [mailto:hylafax-users-bounce@xxxxxxxxxxx] On Behalf Of Dariusz Dwornikowski
Sent: Friday, June 23, 2006 11:13 AM
To: hylafax-users@xxxxxxxxxxx
Subject: [hylafax-users] xferfaxlog parses

Are there any utilities for making a statistics from xferfaxlog?

-- 
Pozdrowienia,
Dariusz Dwornikowski  -  Programista UNIX
Vercom


____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*

____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*




Project hosted by iFAX Solutions