Splunk Search

Error in 'EvalCommand': Type checking failed. '/' only takes numbers.

sumarri
Path Finder

I am getting this error:

 

Error in 'EvalCommand': Type checking failed. '/' only takes numbers.

 

Here is lines of SPL:

| stats count as "Count of Balances", sum(BALANCECHANGE) as "SumBalances" by balance_bin
| eventstats sum("SumBalances") as total_balance
| eval percentage_in_bin = round(("SumBalances" / total_balance) *100, 2)

What could be causing this? Is there a way to olve this without the / symbol? 

Labels (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The eval is trying to divide a string literal ("SumBalances") by a field, which won't work.  Replace the double quotes with single quotes or remote the double quotes.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

sumarri
Path Finder

Thank you so much! That worked! 

richgalloway
SplunkTrust
SplunkTrust

The eval is trying to divide a string literal ("SumBalances") by a field, which won't work.  Replace the double quotes with single quotes or remote the double quotes.

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...