Other Usage

How to combine the result of 2 search queries

Hadad
Engager

I'm trying to combine 2 CSV files, where:

- test-ad has the field "EmailAddress" and "Enabled";
- "Composição das tribos - Relação funcionários.csv") has the field "email" and "rh_status";

So, i can't combine the results:

index="teste-ad" OR (index="tst-compliance" AND source="Composição das tribos - Relação funcionários.csv")
| eval em=coalesce(EmailAddress,email)
| table em Enabled rh_statusa.png

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The results are combined, but they need to be merged.  Use the stats command for that.

index="teste-ad" OR (index="tst-compliance" AND source="Composição das tribos - Relação funcionários.csv")
| eval em=coalesce(EmailAddress,email)
| stats values(*) as * by em
| table em Enabled rh_status

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

Hadad
Engager

Thank you so much.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The results are combined, but they need to be merged.  Use the stats command for that.

index="teste-ad" OR (index="tst-compliance" AND source="Composição das tribos - Relação funcionários.csv")
| eval em=coalesce(EmailAddress,email)
| stats values(*) as * by em
| table em Enabled rh_status

 

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco + Splunk! We’ve ...

Enterprise Security Content Update (ESCU) | New Releases

In April, the Splunk Threat Research Team had 2 releases of new security content via the Enterprise Security ...