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!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...