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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...