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

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...