Splunk Search

How to transform above result into below table?

csahoo
Explorer

index="*dockerlogs*" source="*gps-request-processor-dev*" OR source="*gps-external-processor-dev*" OR source="*gps-artifact-processor-dev*"
| eval LabelType=coalesce(labelType, documentType)
| stats count(eval(status="Received" AND source like "%gps-request-processor%" )) as received count(eval(status="Failed")) as failed by LabelType


LabelType               Received            Failed
----------                      --------                 ------
CARRIERLABEL       2                          2
NIKE                            39                        35
TASKSTART             1                           0


i want to transform above result into below table

1) where category can be 'external' or 'internal'
      if labeltype is 'CARRIERLABEL' then category is 'external' else for other labeltype it should be 'internal'

2)  successcount = Received - failed


category               successcount
--------                    -------------
external                0
internal                 5

0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
index="*dockerlogs*" source="*gps-request-processor-dev*" OR source="*gps-external-processor-dev*" OR source="*gps-artifact-processor-dev*"
| eval LabelType=coalesce(labelType, documentType)
| stats count(eval(status="Received" AND source like "%gps-request-processor%" )) as received count(eval(status="Failed")) as failed by LabelType
| eval category=if(LabelType="CARRIERLABEL","external","internal")
| eval successcount = received - failed
| stats sum(successcount) as successcount by category

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
index="*dockerlogs*" source="*gps-request-processor-dev*" OR source="*gps-external-processor-dev*" OR source="*gps-artifact-processor-dev*"
| eval LabelType=coalesce(labelType, documentType)
| stats count(eval(status="Received" AND source like "%gps-request-processor%" )) as received count(eval(status="Failed")) as failed by LabelType
| eval category=if(LabelType="CARRIERLABEL","external","internal")
| eval successcount = received - failed
| stats sum(successcount) as successcount by category
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...