I am trying to build a timechart that includes the avg rate we pay our carrier per min over time. The issue is for me to calculate this I really need to have
My data includes the number of minutes billed(min) and the amount(fee). I need to get the avg by dividing fee over min.
My source data looks like this:
date,carrier,location,calls,min,fee
2010-10-31 GMT+12:00/+0000,AcmeTel,AB,2,0,0.0
2010-10-31 GMT+11:00/+0000,AcmeTel,AB,13,4,612340.02499961853027
2010-10-31 GMT+10:00/+0000,AcmeTel,AB,1121,66,57317.4404942989349
2010-10-31 GMT+09:00/+0000,AcmeTel,AB,6951,317,1237.1152408123016
2010-10-31 GMT+08:00/+0000,AcmeTel,AB,13548,379,21623.901252269745
2010-10-31 GMT+07:00/+0000,AcmeTel,AB,9162,362,14353.2052426338196
2010-10-31 GMT+06:00/+0000,AcmeTel,AB,3190,181,7077.094498872757
2010-10-31 GMT+05:00/+0000,AcmeTel,AB,1000,63,2765.5147514343262
2010-10-31 GMT+04:00/+0000,AcmeTel,AB,1155,103,4368.79524874687195
2010-10-31 GMT+03:00/+0000,AcmeTel,AB,535,55,2628.31174778938293
Ideally my query would look something like this:
sourcetype="cdrreports" NOT location | timechart sum(fee), sum(min) by carrier | rename sum(fee) as fee | rename sum(min) as min | eval AvgPerMin=fee/min
this will not work however because timechart can only have a single value calculated.
The simple sounding solution is to do something like this:
sourcetype="cdrreports" NOT location | eval AvgPerMin=fee/min | timechart avg(AvgPerMin) by carrier
That won't work however since you are then creating averages of averages.
Any idea how to create something like this?
... View more