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!

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

Get ready to show some Splunk Certification swagger at .conf24!

Dive into the deep end of data by earning a Splunk Certification at .conf24. We're enticing you again this ...

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

Now On-Demand Join us to learn more about how you can leverage Service Level Objectives (SLOs) and the new ...