Dashboards & Visualizations

Can Splunk handle long digit number without rounding?

takaakinakajima
Path Finder

In v7.1.2, a SPL

| makeresults count=1 | eval num="1234567890123456789012345678901234567890"

returns 1234567890123456789012345678901234567890 as string. However,

| makeresults count=1
| eval num1="1234567890123456789012345678901234567890", num2=1
| eval total=num1+num2

returns rounded 'total' value 1234567890123456800000000000000000000000.
(We want true result 1234567890123456789012345678901234567891.)

Can we treat long digit decimal number correctly in SPL?

Tags (1)

takaakinakajima
Path Finder

@kamlesh_vaghela

It's a nice idea using custom app to enable treat long digit decimals like as BigDecimal in Java.
It is same as other computer language, implementation of real numbers in Splunk's has limitation.

@woodcock
I think the limitation is not problem essentially.
However it may become potential of unexpected behaviors for non-technical user.

0 Karma

woodcock
Esteemed Legend

You are cheating and complicating the actual problem by putting double-quotes around the value of num. There is a problem regardless. Open a support ticket but do not expect that anything will be done to make it work.

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@takaakinakajima

It's hard to have it in SLP but you can try it by creating a custom command by writing basic mathematical operations. I have tried it with python. Maybe it will help you. Below are basic workaround what I did with python.

>>> a=123456789123456789123456789123456789123456789123456789123456789123456789123456789
>>> b=123456789123456789123456789123456789123456789123456789123456789123456789123456790
>>> c=a+b
>>> c
246913578246913578246913578246913578246913578246913578246913578246913578246913579L

Happy Splunking

Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...