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!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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