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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...