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

Labels (1)
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 Lantern | Getting Started with Edge Processor, Machine Learning Toolkit ...

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

Enterprise Security Content Update (ESCU) | New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 2 releases of new security content via the ...

Announcing the 1st Round Champion’s Tribute Winners of the Great Resilience Quest

We are happy to announce the 20 lucky questers who are selected to be the first round of Champion's Tribute ...