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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...