Splunk Search

Subsearch question

lokispundit
New Member

I have a large search:

search index="XXX" which has host as field. This includes data for two locations.

I need to filter search that for hosts that exist in each location (Z,Y).

I setup an inputlookup for host.csv with 2 columns and did the following:

|inputlookup host.csv | fields MAC,Location | where Location="Z" | rename MAC as host|

I've added that to my larger search like this:

search index="XXX" | join host [|inputlookup host.csv | fields MAC,Location | where Location="Z" | rename MAC as host] | dedup host

However the results are little inconsistent. Based on the CSV I see 584 hosts for Z and 250 hosts for Y. However my search only finds some of these -- i.e 420 for Z and 196 for Y.

I "think" this is a result of all hosts not appearing in the index, but I'm also a little unsure of the join I used.

Any help/advice is appreciated!

Tags (1)
0 Karma

sideview
SplunkTrust
SplunkTrust

Can you add a little more information about what you're trying to do?

Reading your description I'm not sure you need to be using join at all. It seems almost like what you're trying to do is as simple as:

index="XXX" | lookup hosts MAC as host OUTPUT Location | where Location="Z" | stats count by host
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...