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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...