Dashboards & Visualizations

help for changing the label of a pie chart

jip31
Motivator

hello
I use the stats below in order to display a pie chart with 2 labels

| stats count as NbHostHealthInf85 
| appendcols 
    [| inputlookup host.csv 
    | stats count as NbIndHost] 
| eval NbHostHealthSup85 = (NbIndHost - NbHostHealthInf85) 
| eval NbHostHealthSup85=NbHostHealthSup85, NbHostHealthInf85=NbHostHealthInf85 
| table NbHostHealthSup85 NbHostHealthInf85 
| transpose

I need to replace NbHostHealthSup85 by >85% and NbHostHealthInf85 by <85%
What is the good way to do this because I m doing for example | stats count as "<85%" but it doesnt works

Tags (1)
0 Karma
1 Solution

jitendragupta
Path Finder

Try renaming:

| stats count as NbHostHealthInf85 
 | appendcols 
     [| inputlookup host.csv 
     | stats count as NbIndHost] 
 | eval NbHostHealthSup85 = (NbIndHost - NbHostHealthInf85) 
 | eval NbHostHealthSup85=NbHostHealthSup85, NbHostHealthInf85=NbHostHealthInf85 
 | table NbHostHealthSup85 NbHostHealthInf85  
| rename NbHostHealthSup85 as ">85%", NbHostHealthInf85 as "<85%"
 | transpose

View solution in original post

0 Karma

jitendragupta
Path Finder

Try renaming:

| stats count as NbHostHealthInf85 
 | appendcols 
     [| inputlookup host.csv 
     | stats count as NbIndHost] 
 | eval NbHostHealthSup85 = (NbIndHost - NbHostHealthInf85) 
 | eval NbHostHealthSup85=NbHostHealthSup85, NbHostHealthInf85=NbHostHealthInf85 
 | table NbHostHealthSup85 NbHostHealthInf85  
| rename NbHostHealthSup85 as ">85%", NbHostHealthInf85 as "<85%"
 | transpose
0 Karma

jip31
Motivator

perfect thanks

0 Karma

snigdhasaxena
Communicator

Hi,
Since | stats count as "<85%" this will create a field named ,"<85%" and field name should not start with a relational operator hence it doesn't work. Try naming the count field as something "Lessthan85" and it will work

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...