Splunk Search
Highlighted

How to create a pie chart to compare data between two months?

New Member

Hello,

I need to create a pie chart to compare with this month "February" and the month of last year "February 2015". This is my search, but I need this option 😕

index=aut_kpi2 $servicesToken$ $catalogToken$ $subscriptionToken$         
            | chart count as Total_count by service_offering_name 
            | sort -Total_count| head $topToken$
            | eval signature_slice = "Total: " + service_offering_name + ": " + Total_count
            | fields signature_slice, Total_count

Thanks in advance.

0 Karma
Highlighted

Re: How to create a pie chart to compare data between two months?

SplunkTrust
SplunkTrust

Try something like this

index=aut_kpi2 earliest=@mon latest=@m $servicesToken$ $catalogToken$ $subscriptionToken$ 
| chart count as Total_count_ThisMonth by service_offering_name  | sort -Total_count| head $topToken$
| eval signature_slice = "Total: " + service_offering_name + ": " + Total_count
| fields signature_slice, Total_count
| append [search index=aut_kpi2 earliest=-1y@mon latest=-1y@mon+1mon $servicesToken$ $catalogToken$ $subscriptionToken$ 
| chart count as Total_count_LastYearThisMonth by service_offering_name | sort -Total_count_LastYearThisMonth | head $topToken$
| eval signature_slice = "Total: " + service_offering_name + ": " + Total_count_LastYearThisMonth 
| fields signature_slice, Total_count_LastYearThisMonth ] | stats values(*) as * by service_offering_name 
0 Karma