Splunk Search

Is there a way that I can output my values as a fraction instead of a decimal?

MatthewH007
Path Finder

Is there a way that I can output my values as a Fraction?

Example:

A = 1
B = 2

eval New_Value = A/B

New_Value = 1/2

I tried simply messing around with the printf command but just kept getting errors. I don't need the fraction to be lowered down to LCD (lowest common denominator) just to output A/B. My end goal is to put this in a dashboard panel. I realize I can probably get something similar to work messing with the XML, but the problem would be if someone zoomed in / out, then the alignment would be off. I would like to have just ONE "tile" with a fraction in it.

Any insight or help would be greatly appreciated.

0 Karma
1 Solution

Vijeta
Influencer

Hi @MatthewH007 Can you try concatenating it .

eval New_Value= A."/".B

View solution in original post

Vijeta
Influencer

Hi @MatthewH007 Can you try concatenating it .

eval New_Value= A."/".B

MatthewH007
Path Finder

Just what I needed. 🙂

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...