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!

Introducing the Splunk Community Dashboard Challenge!

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

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...