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!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

 Ready to master Kubernetes and cloud monitoring like the pros? Join Splunk’s Growth Engineering team for an ...

Update Your SOAR Apps for Python 3.13: What Community Developers Need to Know

To Community SOAR App Developers - we're reaching out with an important update regarding Python 3.9's ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...