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
Labels (1)
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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...