Splunk Search

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

rahhali22
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

somesoni2
Revered Legend

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
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...