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!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

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