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!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

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

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

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