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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

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