Splunk Search

How to create a chart from a search finding percentages?

brywilk_umich
Path Finder

I know Im likely missing something easy, but I cant seem to get the output how I would like. I have the below search that works great to find the percentage available but I would like to make this into a pie chart with Available and Unavailable numbers

index=nagios tag::src_host=collaboration (perfdata="HOSTPERFDATA" hoststate) OR (name="check_smtp" perfdata="SERVICEPERFDATA") | eval availabilityStatus=if(hoststate="DOWN" OR severity="CRITICAL","Unavailable","Available") | stats count(eval(availabilityStatus="Unavailable")) as unavailCount, count(eval(availabilityStatus="Available")) as availCount, count as totalCount | eval percentAvailable=(availCount/totalCount)*100

thanks all

0 Karma
1 Solution

somesoni2
Revered Legend

Try this

index=nagios tag::src_host=collaboration (perfdata="HOSTPERFDATA" hoststate) OR (name="check_smtp" perfdata="SERVICEPERFDATA") | eval availabilityStatus=if(hoststate="DOWN" OR severity="CRITICAL","Unavailable","Available") | stats count by availabilityStatus

This should give a pie chart with count of 'Available' and 'Unavailable' counts (with percent on tooltip,calculated automatically.

View solution in original post

somesoni2
Revered Legend

Try this

index=nagios tag::src_host=collaboration (perfdata="HOSTPERFDATA" hoststate) OR (name="check_smtp" perfdata="SERVICEPERFDATA") | eval availabilityStatus=if(hoststate="DOWN" OR severity="CRITICAL","Unavailable","Available") | stats count by availabilityStatus

This should give a pie chart with count of 'Available' and 'Unavailable' counts (with percent on tooltip,calculated automatically.

Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...