Hello, everybody!
Does anybody can help me understand why the following subsearch not limits the results of the outer search to events from only one host?
index=_internal [search index=_internal | top limit=1 host | table host]
This is a test query, of course I have more meaningful subsearch and outer searches, my goal is to get a set of hosts from the subsearch and then query events from only these hosts in the outer search. Obviously the subsearch ends up with
( ( host="TheHostName" ) )
but I still get events from 100+ hosts from the outer search. Looks very strange to me.
I ended up with upgrading to 7.3.5 (most current 7.x release). It seems I caught the bug with my 7.3.2 https://answers.splunk.com/answers/781748/major-bugs-in-searches-in-splunk-73-do-not-upgrade.html
Actually the problem gone after I upgraded SH cluster members, not even search peers.
I ended up with upgrading to 7.3.5 (most current 7.x release). It seems I caught the bug with my 7.3.2 https://answers.splunk.com/answers/781748/major-bugs-in-searches-in-splunk-73-do-not-upgrade.html
Actually the problem gone after I upgraded SH cluster members, not even search peers.
I tested your query and it correctly limits the results to 1 host for me. If you look at job inspector, does the query look correct? I'm thinking maybe there is a search filter on your role that is getting applied and skewing the results.
Hello, @masonmorales I checked the job inspector and see the following: subsearch returns 2 hosts, but the outer search still doesn't filter on these. Actually I expected normalizedSearch to be something like index=_internal (host="m...62" OR host="m...03"))
I run on Splunk 7.3.2
I have just tested the same query on the another Splunk instance which is 7.1.2 an it runs as expected, subsearch filters the outer search results. The remoteSearch
on this instance looks like index=_internal (host="host1" OR host="host2" OR host="host3")
. I wonder what may be wrong with my first instance, I'm Splunk admin
built-in role on both instances...
well, when there is more than one SH or idx, this will be happen, I guess.
I'll learn a lot.