I've created a summary index that counts transactions by customer, transaction type, and hour. I'd like to create weekly and daily roll-up totals by customer and transaction type as a percentage of total. For example
Customer TranType WeekNumber Total % of Total
Acme REF 37 14,423 29%
Acme ACT 37 33,241 66%
Acme DEB 37 2,342 5%
Acme REF 38 9,871 40%
Acme ACT 38 12,389 50%
Acme DEB 38 2,311 9%
Mitsara Industries REF 37 12,312 16%
Mitsara Industries ACT 37 23,121 30%
Mitsara Industries DEB 37 41,231 54%
Mitsara Industries REF 38 53,411 54%
Mitsara Industries ACT 38 31,341 32%
Mitsara Industries DEB 38 13,451 14%
Here's the search I have so far. I'm having trouble figuring out how to add a total by week and customer (excluding tran type) to use for the % of Total calculation:
index=summary search_name="Tran Count By Customer"| table CustomerName psrsvd_gc _time TransactionType |eval week=strftime(_time, "%U")|rename psrsvd_gc as TransCount |stats sum(TransCount) by TransactionType, week, CustomerName
Here's some sample summary index data:
10/07/2015 00:00:00 -0500, search_name="Tran Count By Customer", search_now=1444280400.000, info_min_time=1444194000.000, info_max_time=1444280400.000, info_search_time=1444280427.755, CustomerGuid="ba02683a-f886-4d37-93b1-c2609be937e6", CustomerName="Acme", TransactionType=REF, psrsvd_gc=36, psrsvd_v=1
10/07/2015 01:00:00 -0500, search_name="Tran Count By Customer", search_now=1444280400.000, info_min_time=1444194000.000, info_max_time=1444280400.000, info_search_time=1444280427.755, CustomerGuid="ba02683a-f886-4d37-93b1-c2609be937e6", CustomerName="Acme", TransactionType=ACT, psrsvd_gc=196, psrsvd_v=1
10/07/2015 02:00:00 -0500, search_name="Tran Count By Customer", search_now=1444280400.000, info_min_time=1444194000.000, info_max_time=1444280400.000, info_search_time=1444280427.755, CustomerGuid="ba02683a-f886-4d37-93b1-c2609be937e6", CustomerName="Acme", TransactionType=DEB, psrsvd_gc=2231, psrsvd_v=1
10/07/2015 00:00:00 -0500, search_name="Tran Count By Customer", search_now=1444280400.000, info_min_time=1444194000.000, info_max_time=1444280400.000, info_search_time=1444280427.755, CustomerGuid="87be9e53-9014-404d-b231-e29d4ab13766", CustomerName="Mistara Industries", TransactionType=REF, psrsvd_gc=321, psrsvd_v=1
10/07/2015 01:00:00 -0500, search_name="Tran Count By Customer", search_now=1444280400.000, info_min_time=1444194000.000, info_max_time=1444280400.000, info_search_time=1444280427.755, CustomerGuid="87be9e53-9014-404d-b231-e29d4ab13766", CustomerName="Mistara Industries", TransactionType=ACT, psrsvd_gc=231, psrsvd_v=1
10/07/2015 02:00:00 -0500, search_name="Tran Count By Customer", search_now=1444280400.000, info_min_time=1444194000.000, info_max_time=1444280400.000, info_search_time=1444280427.755, CustomerGuid="87be9e53-9014-404d-b231-e29d4ab13766", CustomerName="Mistara Industries", TransactionType=DEB, psrsvd_gc=654, psrsvd_v=1
... View more