Dashboards & Visualizations

How can I add a percentage sign to the radial gauge number that is displayed ?

lucasdc
New Member

Hi splunkers!

I got this query and I would like to display the percentage symbol in a radial gauge , but it doenst display the number with "%" inside of the gauge.

What do I have to do for get this done?
index="db_archer2" sourcetype="db_archer2" "C_xE1lculo ponto Aberto _ Fechado"="Aberto" "Criticidad _CVSS"="Cr\xEDtico"OR"Criticidad _CVSS"="Alta" "Risco Atual do ponto"="Real" "Gestion vulnerabilidades"="Web Gestionadas Internamente"OR"Gestion vulnerabilidades"="Webs Externalizadas"OR"Gestion vulnerabilidades"="Apps M\xF3viles" "Respons_xE1vel T_xE9cnico pela Corre_xE7_xE3o"!="Equipe Fraudes" "Nome do Projeto"!="Cyber-Hunting"OR"Nome do Projeto"!="Purple Team""Torre DTI"!="Coligada - Zurich"OR"Torre DTI"!="Coligada - SuperDigital"OR"Torre DTI"!="Coligada - Ole"OR"Torre DTI"!="Coligada - S3"OR"Torre DTI"!="Coligada - GetNet"OR"Torre DTI"!="Coligada - Universia"
| stats count as IFA
| eval IFA = round((IFA/156)*100, 2)
| eval IFA =tostring('IFA')."%"
| gauge IFA 0 1 3 4

Thanks for advance!

Tags (1)
0 Karma

Sukisen1981
Champion

hi @lucasdc this might not be possible at all using default config.
However, there is a fantastic answer already from @niketnilay which i have used and can vouch for
https://answers.splunk.com/answers/717431/how-can-i-add-a-percentage-sign-to-the-radial-gaug.html

niketn
Legend

@lucasdc do try out and confirm. Accept the answer if it resolves your issue, if not let us know.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

lucasdc
New Member

I have tried this script but I dont know where I gotta put this second part of the code:

require([
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/simplexml/ready!'
], function ($,mvc) {
console.log("Script Started");
var unsubmittedTokenModel=mvc.Components.get("default");
mvc.Components.get("my_radial_gauge").getVisualization(function(chartView) {
chartView.on('rendered', function() {
setTimeout(function(){
var strResultColor=unsubmittedTokenModel.get("tokResultColor");
if(strResultColor!==undefined){
console.log("strResultColor: ",strResultColor);
$("#my_radial_gauge svg text:last-child").css("fill",strResultColor);
$("#my_radial_gauge svg text:last-child").append( " %" );
}
},100);
});
});
});

Could you guys help me to find out ?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...