Splunk Search

How to sum two numeric fields resulting in a concatenation of the two fields?

patouellet
Path Finder

Hello Splunk Ninjas,

First time I've seen this: I have two fields, clearly regognised as numeric fields by Splunk. They are named:
"Put Count"
"Put1 Count"

I want to sum these fields, so I do this:

eval Put_Count_Sum= "Put Count" + "Put1 Count"

But instead of Put_Count_Sum being the sum of both fields, Put_Count_Sum is equal to the text string: "Put CountPut1 Count"

I understand it might have something to do with my fields having spaces, but not sure how to work around that.

Thank you.

0 Karma
1 Solution

horsefez
SplunkTrust
SplunkTrust

Hi @patouellet,

try using
eval Put_Count_Sum= 'Put Count' + 'Put1 Count'

View solution in original post

horsefez
SplunkTrust
SplunkTrust

Hi @patouellet,

try using
eval Put_Count_Sum= 'Put Count' + 'Put1 Count'

patouellet
Path Finder

Thank you works perfectly.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...