Splunk Search

Sum the values in a field

Madhusri
Engager

Hi Team,

Current table

ApplicationFailureSuccess
A26
B47
C58

 

Expected

ApplicationFailureSuccess
D1121

 

How to add the Applications values and make it as new application. Also need to sum all the failures and success values.

Can anyone help on this?

Regards,

Madhu R

Labels (1)
Tags (1)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @Madhusri,

It is clear now 🙂 Please try below;

| appendpipe 
    [ search Application IN (A,B,C) 
    | stats sum(Failure) as Failure sum(Success) as Success 
    | eval Application="D"] 
| search NOT Application IN (A,B,C) 
| sort Application
If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @Madhusri,

It is clear now 🙂 Please try below;

| appendpipe 
    [ search Application IN (A,B,C) 
    | stats sum(Failure) as Failure sum(Success) as Success 
    | eval Application="D"] 
| search NOT Application IN (A,B,C) 
| sort Application
If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @Madhusri,

Can you try below?

| stats sum(Failure) as Failure sum(Success) as Success
| eval Application="D"
| table Application Failure Success
If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

Madhusri
Engager

@scelikok 

 

Updated

 

Current table

ApplicationFailureSuccess
A26
B47
C58
E58

 

Expected

ApplicationFailureSuccess
D1121
E58

 

Need to combine A,B,C as D and in the table E Application also needed

 

Regards,

Madhusri R

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

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