Splunk Search

how to calculate sum of two fields using eval command?

Madhan45
Path Finder

I have column A and B, its values are

A- 5,10,15,20
B-1,2,3,4

i need the Total in third field which should contain their addition like below:
Total-6,12,18,24.

how can i use eval command for that.??

Tags (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Are A and B multi-value fields?

---
If this reply helps you, Karma would be appreciated.
0 Karma

woodcock
Esteemed Legend

Like this:

... | eval Total = A + B

Madhan45
Path Finder

for sub,mul,div "A-B", "A*B","A/B" is it so?

0 Karma

woodcock
Esteemed Legend

Exactly, provided that both A and B are single-valued files; is either multi-valued?. Don't forget to click "Accept".

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...