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!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...