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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...