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!

Splunk ITSI & Correlated Network Visibility

  Now On Demand   Take Your Network Visibility to the Next Level In today’s complex IT environments, ...

Community Content Calendar, August edition

In the dynamic world of cybersecurity, staying ahead means constantly solving new puzzles and optimizing your ...

Pro Tips for First-Time .conf Attendees: Advice from SplunkTrust

Heading to your first .Conf? You’re in for an unforgettable ride — learning, networking, swag collecting, ...