Splunk Search

Insert "%" symbol to a number without converting it to string

jvmerilla
Path Finder

Hi,

Is it possible to add a "%" character/symbol to a number without converting it to a string?

I tried to use this code:
| eval percentage = round((On_time/Total)*100)."%"

But it converted the number into a string, so when I try to use the "percentage" field as an overlay in a Column Chart, it does not show anything. It has to be an integer.
I want it to have the "%" character so that when I hover over the overlay, the value would have the "%" sign so that it would be easy to know that it is a percentage, not just any number.

Is this possible?

I hope anyone can help me with this.

Thank you.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

By definition, a field with anything other than digits or '.' is a string. There is no way around that.
If you were using a pie chart, you could use the SimpleXML charting.chart.showPercent option to display percentages, but that is not supported by other chart types.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

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 ...