Splunk Search

Compare value of row'1', column'1' with row'n', column'n' and if matched then diff=(Size_In_MB_new-Size_In_MB)

RajanRaj
New Member

I want to compare (OWNER)(TABLE_NAME) to (OWNER_New)(TABLE_NAME_New). And once the value matched then want to find difference between  Size_In_MB_new and Size_In_MB.

Catch is i do not want to only compare the value of (OWNER)(TABLE_NAME) in same row, i want it to search for the same value in all row of (OWNER_New)(TABLE_NAME_New) and if match found then perform difference of desired fields.

 

OWNERTABLE_NAMESize_In_MBOWNER_NewTABLE_NAME_NewSize_In_MB_New
MZOWNERSYSTEM_LOG121620RB_CUSTOMIPGINVOICETRANSACTIONARCHIVE158115
GENEVA_ADMINIPGEMSV5US89920MZOWNERSYSTEM_LOG121620
GENEVA_ADMINIPGEMSV7US53696GENEVA_ADMINIPGEMSV5US89920
GENEVA_ADMINEVENTMAPPINGSETVALUE38656GENEVA_ADMINIPGEMSV7US53696
GENEVA_ADMINIPGEMSV5GB14528GENEVA_ADMINEVENTMAPPINGSETVALUE38720
RB_CUSTOMIPGINVOICEGROUPARCHIVE13414RB_CUSTOMIPGNONINVOICETRANARCHIVE31617
GENEVA_ADMINIPGEMSV7GB12352GENEVA_ADMINIPGEMSV5GB14528
GENEVA_ADMINIPGEMSV7IT11712RB_CUSTOMIPGINVOICEGROUPARCHIVE13606
GENEVA_ADMINIPGEMSV7MY10688GENEVA_ADMINIPGEMSV7GB12352
GENEVA_ADMINCUSTPRODUCTCHARGE10378GENEVA_ADMINIPGEMSV7IT11712
Tags (1)
0 Karma

spitchika
Path Finder
 

Try this way, it works as I am using similar joins.

Fields names in both tables should be same otherwise rename them using "rename " command

index=abc source=abc
| join type=inner owner,table_name [ search index=xyz source=xyz
| stats Size_In_MB_New]
| stats owner,table_name,Size_In_MB,Size_In_MB_New
| eval DiffSize= Size_In_MB -Size_In_MB_New

0 Karma
Get Updates on the Splunk Community!

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Your Voice Matters! Help Us Shape the New Splunk Lantern Experience

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

Building Momentum: Splunk Developer Program at .conf25

At Splunk, developers are at the heart of innovation. That’s why this year at .conf25, we officially launched ...