Splunk Search

how to format numbers ina simpleresultstable?

sou128
Explorer

currently my simpletresultstable is showing

myDecimalfield1 | myNumfield1 | MyCalculatedField1

1234.56789 | 1 | 1234.56789 <--- myDecimalfield1 divided by myNumfield1

how can I format myDecimalfield1 and MyCalculatedField1 to show only 2 decimal places? thx

0 Karma
1 Solution

sdaniels
Splunk Employee
Splunk Employee

Use eval with round().

| eval myField = round(myNumField1 ,2)

http://docs.splunk.com/Documentation/Splunk/4.3.2/SearchReference/CommonEvalFunctions

Then is display the new field (myField) in your table.

View solution in original post

sdaniels
Splunk Employee
Splunk Employee

Use eval with round().

| eval myField = round(myNumField1 ,2)

http://docs.splunk.com/Documentation/Splunk/4.3.2/SearchReference/CommonEvalFunctions

Then is display the new field (myField) in your table.

Get Updates on the Splunk Community!

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

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...