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!

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

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

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...

Introducing the Splunk Community Dashboard Challenge!

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