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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...