All Apps and Add-ons

Subtract results of subquery from main query

raghu0463
Explorer

Hi Wanted to subract the subquery results from main query. i.e

index=main source=/folder/abc.csv  |table customername - [index=main source=/folder/xxx.csv |table name ] 

can this be achievable ? i want to get only the names which are not common from both the files.

Thanks

0 Karma

to4kawa
Ultra Champion
index=main source=/folder/abc.csv OR source=/folder/xxx.csv
| eval name=coalesce(name,customername)  
| eventstats dc(source) as flag by name
| where flag=1 AND source="/folder/abc.csv"
| table name   

Hi, how about this?

0 Karma

raghu0463
Explorer

I apologize, there's small change in my question

0 Karma

skoelpin
SplunkTrust
SplunkTrust

You gotta do it outside of the subsearch like such.

search abc.csv |table name  [search xxx.csv |table name ]
| eval new_field=name_one-name_two
0 Karma

raghu0463
Explorer

hi skoelpin,
im getting the below error

" 'table' command: Invalid argument: 'name=swbsubwg361'"

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...