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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...